-
-
Notifications
You must be signed in to change notification settings - Fork 11k
TST,TYP: Fix a python 3.11 failure for the GenericAlias
tests
#21543
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
Conversation
So could we avoid it altogether, or is it needed for some other obscure reason? If we cannot drop it now, but can drop |
Adding a comment is a good idea though, I'll add one in a bit. |
Thanks @BvB93 |
Thanks a lot for this effort! While the previous error is now gone, it seems that Failure summary
|
Closes #21526
Fixes (sort of...) a python 3.11 issue wherein the
npt._GenericAlias
class (not instance) can now raise when used as a type parameter, as typing expects an iterable for the__parameter__
attribute but instead gets aproperty
descriptor object.The fix consists of simply not using
npt._GenericAlias
as a type parameter, and instead just stringify the expression. As the relevant class is never exposed in Python >=3.9 in the first place (and never will), I don't feel it's worth to implement a more rigorous fix.