Message383747
Currently get_args doesn't work for PEP 604 Union:
>>> get_args(int | str)
or new Callables with PEP 612:
>>> P = ParamSpec('P)
>>> get_args(Callable[P, int])
([~P], <class 'int'>)
get_origin doesn't work with PEP 604 Unions:
>>> get_origin(int | str)
PS: the fix has to be backported partly to 3.9. Because get_args doesn't handle collections.abc.Callable either. |
|
Date |
User |
Action |
Args |
2020-12-25 15:19:22 | kj | set | recipients:
+ kj, gvanrossum, levkivskyi |
2020-12-25 15:19:22 | kj | set | messageid: <1608909562.21.0.0257515668126.issue42740@roundup.psfhosted.org> |
2020-12-25 15:19:22 | kj | link | issue42740 messages |
2020-12-25 15:19:22 | kj | create | |
|