-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
TypedDict.keys() and items() should return KeysView and ItemsView #3473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This can actually be implemented by modifying the typeshed stub for |
@JukkaL GitHub now supports direct transfer of issues between repos, I think it makes sense to just move it to typeshed. |
hauntsaninja
pushed a commit
to hauntsaninja/typeshed
that referenced
this issue
Dec 6, 2019
hauntsaninja
pushed a commit
to hauntsaninja/mypy
that referenced
this issue
Dec 8, 2019
The signature of TypedDict's keys, values, items will be updated in typeshed in: python/typeshed#3529 The relevant issue is: python/typeshed#3473
hauntsaninja
pushed a commit
to hauntsaninja/mypy
that referenced
this issue
Dec 8, 2019
The signature of TypedDict's keys, values, items will be updated in typeshed in: python/typeshed#3529 The relevant issue is: python/typeshed#3473 That PR fails testTypedDictMappingMethods https://travis-ci.org/python/typeshed/builds/621439570 Tested by using my patched version of typeshed: ln -sf ~/typeshed mypy/typeshed pytest -n0 -k testTypedDictMappingMethods
JelleZijlstra
pushed a commit
that referenced
this issue
Mar 14, 2020
Fixes #3473 Co-authored-by: hauntsaninja <>
JelleZijlstra
pushed a commit
to python/mypy
that referenced
this issue
Mar 14, 2020
The signature of TypedDict's keys, values, items will be updated in typeshed in: python/typeshed#3529 The relevant issue is: python/typeshed#3473 That PR fails testTypedDictMappingMethods https://travis-ci.org/python/typeshed/builds/621439570 Tested by using my patched version of typeshed: ln -sf ~/typeshed mypy/typeshed pytest -n0 -k testTypedDictMappingMethods Co-authored-by: hauntsaninja <>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reopened from python/mypy#7845 as requested
mypy incorrectly believes that TypedDict.keys() and TypedDict.items() return an AbstractSet, whereas it should be more accurately a KeysView and a ItemsView respectively:
Output:
Expected output:
The text was updated successfully, but these errors were encountered: