-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Prototype support for typed **kwargs #3002
Copy link
Copy link
Closed
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionenhancement requestNew feature or requestNew feature or request
Description
Many people have requested support for a way to type **kwargs with a TypedDict. There have been proposals to support this using the Unpack type introduced in the recently-accepted PEP 646.
It would be good to prototype this to uncover any potential issues.
- How to handle required fields that are not supplied by the caller?
- How to handle function assignment when the source type contains one of these unpacked TypedDicts?
- Is it necessary/desirable to support unions of TypedDicts? This adds significant complexity.
- Should it support
*unpack operator introduced in PEP 646? - How to handle references to
kwargswithin the function implementation? Is it the same as any other TypedDict reference? - How do we deal with the case where a keyword parameter has a name that overlaps with an entry in the TypedDict?
- Should it be an error if an unpacked mapping (with unknown keys) is passed to the function?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionenhancement requestNew feature or requestNew feature or request