Repository navigation
Fix union spillover dispatch on copied converters - #811
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
Aschenbath
marked this pull request as ready for review
October 25, 2026 01:05
This branch has not been deployed
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.
Copying a converter configured with union passthrough leaves spillover handling bound to the original converter. A hook registered on the copy works for
Abut is ignored forint | A;copy(forbid_extra_keys=True)can also accept extra keys inside that union.Make the union hook factory an extended factory so dispatch supplies the converter generating the hook. Spillover then uses the copy's hooks and settings. Regression tests cover
copy()anddeepcopy(), warmed caches followed by hook registration, strict field validation, and a copied JSON converter loading a custom datetime format. The strategy docs and changelog describe the corrected behavior.Validation:
The full upstream CI workflow passes on this exact commit in the fork: all 10 jobs, covering CPython 3.10–3.15, PyPy 3.10, lint, package verification, and 100% combined coverage. The upstream Read the Docs build also passes.
Developed with AI assistance.