You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds support for these methods through additional plugin hooks:
* `pop`
* `setdefault`
* `update` (positional argument only)
* `__delitem__`
These methods also work and don't need plugin support:
* `copy`
* `has_key` (Python 2 only)
* `viewitems` (Python 2 only)
* `viewkeys` (Python 2 only)
* `viewvalues` (Python 2 only)
The base signatures for all of these methods are defined in
`mypy_extensions._TypedDict`, which is a stub-only class
only used internally by mypy. It becomes the new fallback
type of all TypedDicts.
Fixes#3843. Fixes#3550.
There's some possible follow-up work that I'm leaving to other PRs,
such as optimizing hook lookup through dictionaries in the default
plugin, documenting the supported methods, and `update` with
keyword arguments (#6019).
Things like
d.update(x=1, y=2)
should be accepted ifd
is a TypedDict and the keys and values are compatible.The text was updated successfully, but these errors were encountered: