[ty] Omit invalid keyword arguments from TypedDict signature by charliermarsh · Pull Request #24522 · astral-sh/ruff (original) (raw)
Bot added the ty
Multi-file analysis & type inference
label
charliermarsh changed the title
[ty] Omit invalid keyword arguments from TypedDict signature [ty] Omit invalid keyword arguments from TypedDict signature
carljm added a commit that referenced this pull request
- main:
[ty] Fix bad diagnostic range for incorrect implicit
__init_subclass__calls (#24541) [ty] Add aSupportedPythonVersionenum (#24412) [ty] Ignore unsupported editor-selected Python versions (#24498) [ty] Add snapshots for__init_subclass__diagnostics (#24539) [ty] Minor fix in tests (#24538) [ty] AllowFinalvariable assignments in__post_init__(#24529) [ty] Expand test suite for assignment errors (#24537) [ty] Usemap, not__map, as the name of the mapping parameter inTypedDict__init__methods (#24535) [ty] Rework logic for synthesizingTypedDictmethods (#24534) [flake8-bandit] Fix S103 false positives and negatives in mask analysis (#24424) [ty] mdtest.py: update dependencies (#24533) Rename patterns and arguments source order iterator method (#24532) [ty] Omit invalid keyword arguments fromTypedDictsignature (#24522) [ty] support super() in metaclass methods (#24483) [ty] Synthesize__init__forTypedDict(#24476)
carljm added a commit that referenced this pull request
- main:
Bump typing conformance suite commit to latest upstream (#24553)
[ty] Reject deleting
Finalattributes (#24508) [ty] Respect property deleters in attribute deletion checks (#24500) [ty] stop unioning Unknown into types of un-annotated attributes (#24531) [ty] Fix bad diagnostic range for incorrect implicit__init_subclass__calls (#24541) [ty] Add aSupportedPythonVersionenum (#24412) [ty] Ignore unsupported editor-selected Python versions (#24498) [ty] Add snapshots for__init_subclass__diagnostics (#24539) [ty] Minor fix in tests (#24538) [ty] AllowFinalvariable assignments in__post_init__(#24529) [ty] Expand test suite for assignment errors (#24537) [ty] Usemap, not__map, as the name of the mapping parameter inTypedDict__init__methods (#24535) [ty] Rework logic for synthesizingTypedDictmethods (#24534) [flake8-bandit] Fix S103 false positives and negatives in mask analysis (#24424) [ty] mdtest.py: update dependencies (#24533) Rename patterns and arguments source order iterator method (#24532) [ty] Omit invalid keyword arguments fromTypedDictsignature (#24522) [ty] support super() in metaclass methods (#24483) [ty] Synthesize__init__forTypedDict(#24476)
ibraheemdev pushed a commit that referenced this pull request
Summary
If a TypedDict contains keys that aren't valid keyword arguments, we now
omit them from the signature and include an extra **kwargs at the end,
as for, e.g., TypedDict("Config", {"in": int, "x-y": str, "ok": int})
(in is a reserved keyword, and x-i contains a dash, so neither are
valid keyword arguments).
This was referenced
Apr 27, 2026
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
[ Show hidden characters]({{ revealButtonHref }})