FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

stubtest: basic support for unpack kwargs by hauntsaninja · Pull Request #21024 · python/mypy · GitHub

Repository navigation

stubtest: basic support for unpack kwargs - #21024

Merged
hauntsaninja merged 2 commits into
python:masterfrom
hauntsaninja:stubtestunpack
Apr 22, 2026
Merged

hauntsaninja merged 2 commits into
python:masterfrom
hauntsaninja:stubtestunpack

Conversation

Copy link
Copy Markdown
Collaborator

Fixes #21023

Comment thread mypy/test/teststubtest.py
Comment thread mypy/stubtest.py
Comment thread mypy/test/teststubtest.py Outdated
hauntsaninja merged commit f4db3cd into python:master Apr 22, 2026
17 checks passed
hauntsaninja deleted the stubtestunpack branch April 22, 2026 04:46

Copy link
Copy Markdown
Collaborator Author

Thank you for the review!

hauntsaninja pushed a commit that referenced this pull request Oct 21, 2026
Fixes #22238

#21024 made stubtest expand `**kwargs: Unpack[TypedDict]` into keyword
arguments, but only in `Signature.from_funcitem`. Overloads go through
`from_overloadedfuncdef`, which reads each item's raw arguments, so they
still got a plain `**kwargs` and stubtest reported every key as missing.

This moves the expansion into `expand_unpacked_kwargs()` and applies it
to plain functions and to each overload item. The merged overload
signature then picks up the keys like any other keyword arguments, so a
key only present in some overloads is treated as optional.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stubtest doesn't expand **kwargs: Unpack[...]

2 participants


Back | FazBrowse Home | New Git URL