Skip to content

Add tests for hasattr/getattr usage on LookupDict#7401

Merged
nateprewitt merged 1 commit into
mainfrom
lookup_dict_tests
Apr 30, 2026
Merged

Add tests for hasattr/getattr usage on LookupDict#7401
nateprewitt merged 1 commit into
mainfrom
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.

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