Repository navigation
Fix defaulted CatchAll constructor argument ordering - #259
Open
Neallin-917 wants to merge 1 commit into
Open
Neallin-917 wants to merge 1 commit into
Neallin-917 wants to merge 1 commit into
Conversation
AI assistance: OpenAI Codex assisted with the implementation, regression tests, and validation.
Author
|
Could you approve the pending CI run when convenient? This is the narrow CatchAll argument-order fix with regression coverage; local validation and Codex assistance are documented above. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #251.
When a
CatchAllfield with a default factory follows an ordinary defaultedfield, inserting its value into the positional constructor arguments can bind
it to the wrong field. This either raises a duplicate-argument
TypeErroror,for empty input, silently replaces the preceding field's default with
{}.Pass defaulted CatchAll fields by keyword, while preserving positional order
for required CatchAll fields. Twelve parametrized cases cover empty/known/extra
input, keyword-only fields, required-field positions, and a CatchAll field
between defaulted fields. This does not change the cache-marker handling
addressed separately by #253.
Validation
TZ=UTC tox -e py39,py310,py311,py312,py313,py314 --override 'testenv.pass_env=TZ'.884 passed with the same skip/xfail/xpass counts.
without it, both baseline and patch produce December 18 rather than the
asserted December 17. Tox needs the explicit pass-through above.
git diff --checkpasses.Whole-project flake8 has 1782 existing diagnostics on both baseline and patch,
with no added diagnostic. Whole-project pylint is also not clean; this PR
does not attempt unrelated lint/complexity cleanup.
AI assistance: OpenAI Codex assisted with implementation, regression tests,
patch review and running validation. No independent human review is claimed.