Skip to content

Preserve explicit null mapping entries during reference lookup - #100

Open
Aschenbath wants to merge 1 commit into
purcell:mainfrom
Aschenbath:fix/oss20-20261124-bc63-airspeed-null-entries
Open

Aschenbath wants to merge 1 commit into
purcell:mainfrom
Aschenbath:fix/oss20-20261124-bc63-airspeed-null-entries

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

An explicit null mapping entry is currently treated as a missing key during reference lookup. With {"items": None}, $!record.items prints the built-in dict.items method. With {"put": None}, calling $!record.put("added", 1) unexpectedly invokes the compatibility method and changes the dictionary.

Keep a successful lookup of None as an unresolved value, preserving the existing precedence of mapping entries over object attributes and compatibility methods. Missing keys still resolve their usual methods, and non-null or callable entries retain their behavior.

Validation on Python 3.12.12: the regression selection fails on the original source; python -B -m unittest passes all 216 tests after the change. Tests cover null member rendering, defaults, conditions, attribute precedence, unintended mutation, and existing method behavior. The new test file passes Ruff, and git diff --check passes.

Implemented with OpenAI Codex assistance; the verification above was executed locally.

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.

1 participant