Skip to content

Instantly share code, notes, and snippets.

@DuaneR5280
Last active November 24, 2025 19:57
Show Gist options
  • Select an option

  • Save DuaneR5280/7edd7c73a380bf5026fefecd22c4d779 to your computer and use it in GitHub Desktop.

Select an option

Save DuaneR5280/7edd7c73a380bf5026fefecd22c4d779 to your computer and use it in GitHub Desktop.
Compare python dicts
user_profile_a = {
"user_id": 4095,
"username": "dev_alex",
"role": "maintainer",
"is_active": True,
"notifications_enabled": False
}
user_profile_b = {
"user_id": 4095,
"username": "dev_alex_v2",
"role": "admin",
"is_active": True,
"last_login": "2023-10-27"
}
seta = set(user_profile_a.items())
setb = set(user_profile_b.items())
results = seta ^ setb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment