Skip to content

Allow caller keywords to override nested partial presets - #124

Open
Mirochill wants to merge 1 commit into
smarie:mainfrom
Mirochill:fix-nested-partial-keyword-overrides
Open

Mirochill wants to merge 1 commit into
smarie:mainfrom
Mirochill:fix-nested-partial-keyword-overrides

Conversation

@Mirochill

Copy link
Copy Markdown

Fixes #95.

Nested partials currently overwrite caller keyword arguments with their preset defaults. Copy the presets first and then apply caller arguments, consistently for regular functions, generators, asynchronous functions and the legacy coroutine helper.

Five new regression cases fail on the original source. The final complete suite passes102 tests with one existing skip. Isolated Flake8 checks introduce no diagnostics relative to the baseline; the repository's existing inline-comment configuration cannot be parsed by the current Flake8 tool. Added the changelog entry.

Prepared with Codex assistance; implementation and tests independently reviewed.

Fixes smarie#95.

Merge preset keyword defaults before call-time values in regular,
generator and async-generator wrappers. Preserve the inner partial.

Five regressions fail before the fix. Full suite: 102 passed, 1 skipped
on Python 3.12.14; git diff --check clean. No new lint diagnostics
relative to the original implementation.

Assisted-by: OpenAI Codex

This branch has not been deployed

No deployments
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.

Inconsistency in behavior of functools.partial and makefun.partial

1 participant