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
{{ message }}
Repository navigation
Support TypedDict update() with keyword arguments #6019
I think this would need to be added as a specification of the standard. I do not see this as allowed anywhere, and currently the update method is annotated as accepting only a TypedDict in typeshed.
Perhaps this should be moved to the typing repo (or I guess CPython)?
Perhaps this should be moved to the typing repo (or I guess CPython)?
The CPython issue tracker should only be used for tracking changes to the typing.py runtime. Spec changes should go to the python/typing issue tracker.
Activity
Add support for additional TypedDict methods (#6011)
emmatyping commentedon Dec 28, 2024
I think this would need to be added as a specification of the standard. I do not see this as allowed anywhere, and currently the update method is annotated as accepting only a
TypedDictin typeshed.Perhaps this should be moved to the typing repo (or I guess CPython)?
JelleZijlstra commentedon Dec 28, 2024
I don't think this would require a change to the spec. The spec is mostly silent on the
update()method (there is some discussion from the ReadOnly PEP at https://typing.readthedocs.io/en/latest/spec/typeddict.html#update-method), but it wouldn't be against the spec to allowupdate()calls that preserve the type. Pyright also accepts it: https://pyright-play.net/?code=GYJw9gtgBALgngBwJYDsDmUkQWEMoAqiApgCYAiSAxjAFC1UA2AhgM6tQAaAFEQmZRoBKAFy0oEqMxGYUdWqWLAowbgA8ZnUeMlqAdAFcEpZjGLdmAXgCMQ2kAThe CPython issue tracker should only be used for tracking changes to the typing.py runtime. Spec changes should go to the python/typing issue tracker.