Unpack vs Expand #3527
-
Is Unpack[TypedDict] for annotating kwargs is a temporary workaround until Expand will be implemented in both mypy and pyright? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
Unpack[]
was introduced by PEP 646 for*args
. That is currently its only standardized use. An upcoming PEP, PEP 692, will allow using it for**kwargs
too. Pyright already has experimental support for this feature.Expand
is a name that has been floating around in some proposals and in an unmerged mypy PR, but to my knowledge it has not been implemented in any type checkers. I do not expect it to become standardized.