TST,TYP: Fix a python 3.11 failure for the GenericAlias tests#21543
TST,TYP: Fix a python 3.11 failure for the GenericAlias tests#21543mattip merged 2 commits intonumpy:mainfrom
GenericAlias tests#21543Conversation
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._GenericAliasclass (not instance) can now raise when used as a type parameter, as typing expects an iterable for the__parameter__attribute but instead gets apropertydescriptor object.The fix consists of simply not using
npt._GenericAliasas 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.