Skip to content

Honor explicit pop defaults without creating missing values - #338

Open
xiehuanyi wants to merge 1 commit into
cdgriffith:developfrom
xiehuanyi:fix/box-explicit-pop-default
Open

xiehuanyi wants to merge 1 commit into
cdgriffith:developfrom
xiehuanyi:fix/box-explicit-pop-default

Conversation

@xiehuanyi

@xiehuanyi xiehuanyi commented Oct 10, 2026 •

Copy link
Copy Markdown

With default_box=True, Box().pop("missing", fallback) ignores the explicit fallback and calls the configured default factory. If default_box_create_on_get=False, it can instead raise BoxKeyError while deleting the generated but unstored value.

Use the existing default-suppression lookup for pop calls with an explicit fallback, and propagate it through dotted Box and BoxList paths. Return the original fallback object without calling the factory or creating missing values. Add regressions for both creation modes, scalar/collection fallbacks, nested mapping/list paths, and existing camel-case keys. Include the changelog and contributor entry requested by the guide.

Validation on Linux/Python 3.14: 11 of the 12 new cases fail on unchanged develop; all 171 tests pass in pure Python and again after compiling the runtime with Cython, with the declared optional test dependencies installed. Black with the project configuration, Pyflakes, and mypy (8 source files) pass.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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