New submission from Ken Jin <kenjin4...@gmail.com>:
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. ---------- components: Library (Lib) messages: 383747 nosy: gvanrossum, kj, levkivskyi priority: normal severity: normal status: open title: typing.py get_args and get_origin should support PEP 604 and 612 type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42740> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com