-
Notifications
You must be signed in to change notification settings - Fork 35
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
is_generic_type(List)
is False in 3.9
#60
Comments
This same bug has far-reaching effects and is the cause of Instagram/LibCST#305 as well. |
The `_GenericAlias` still exists, but they now subclass `_SpecialGenericAlias`. This affects many things, so just use a tuple up top. Fixes ilevkivskyi#60
This is a little more interesting, and mainly appears to affect unsubscripted types that ought to be considered generic. In 3.8, these have If we apply the trivial fix to consider unsubscripted types to be generic as well, we get a predictable |
Jelle, I had a conversation with Łukasz and I don't feel like we have buy-in on this being a cpython bug. I don't think there's a way to fix this in |
FWIW, a potential fix can be hard-coding some special cases. Technically, I may not have time to work on this soon, but if someone has ideas for a robust fix, I will be glad to merge a PR. |
Similar to what Ivan said, I'm not sure why this can't be fixed in typing-inspect, for example by looking for the I ran into this doing some runtime type inspection in pyanalyze and worked around it with some 3.9-specific code: https://github.com/quora/pyanalyze/blob/master/pyanalyze/annotations.py#L225. Is there a bugs.python.org issue about this? |
FWIW, this means I can't build https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972803 Hopefully someone can implement a fix soonish, since it won't move from unstable to testing until this is fixed. |
…evkivskyi/typing_inspect#60 (comment)) git-svn-id: file:///srv/repos/svn-community/svn@757689 9fca08f4-af9d-4005-b8df-a31f2cc04f65
…evkivskyi/typing_inspect#60 (comment)) git-svn-id: file:///srv/repos/svn-community/svn@757689 9fca08f4-af9d-4005-b8df-a31f2cc04f65
Fixes <ilevkivskyi#60>. Based on an idea in ilevkivskyi#60 (comment).
Apparently in 3.9
List
became an instance of_SpecialGenericAlias
instead of_GenericAlias
, which is whattyping_inspect
checks for.The text was updated successfully, but these errors were encountered: