Skip to content

Add tests for hasattr/getattr usage on LookupDict#7401

Merged
nateprewitt merged 1 commit intomainfrom
lookup_dict_tests
Apr 30, 2026
Merged

Add tests for hasattr/getattr usage on LookupDict#7401
nateprewitt merged 1 commit intomainfrom
lookup_dict_tests

Conversation

@nateprewitt
Copy link
Copy Markdown
Member

This PR codifies a few behaviors on LookupDict that weren't immediately clear when making changes for #7272. Because both dict keys and attributes are intended to operate interchangeably they typically behave identically.

The one exception to that is dict access through ["missing_key"] is treated as None but .missing_key raises an AttributeError. That has implications on hasattr/getattr checks for key presence.

@nateprewitt nateprewitt merged commit 8f6cda9 into main Apr 30, 2026
72 of 73 checks passed
@nateprewitt nateprewitt deleted the lookup_dict_tests branch April 30, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants