[issue40398] get_args(Callable) fails

2020-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6292be7adf247589bbf03524f8883cb4cb61f3e9 by Serhiy Storchaka in branch 'master': bpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720) https://github.com/python/cpython/commit/6292be7adf247589bbf03524f8883cb4cb61f3e9 -

[issue40398] get_args(Callable) fails

2020-04-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +19042 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19720 ___ Python tracker ___

[issue40398] get_args(Callable) fails

2020-04-26 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Oh my, this looks like another bug. I don't have Python 3.8 at hand so just tried `typing_inspect` on Python 3.6. I think this may be caused by the "double use" of _GenericAlias for which you opened your WIP PR. -- _

[issue40398] get_args(Callable) fails

2020-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: get_args(List) == (T,) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40398] get_args(Callable) fails

2020-04-26 Thread Guido van Rossum
Guido van Rossum added the comment: Agreed, that's better! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40398] get_args(Callable) fails

2020-04-26 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I think it should return empty tuple: First, for consistency with other things like get_args(Tuple) == () and get_args(List) == (). Second, although Callable is equivalent to Callable[..., Any] in the static world, authors of some runtime checkers might wan

[issue40398] get_args(Callable) fails

2020-04-26 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe it could return (Ellipsis, Any) in that case. The most general form of Callable is Callable[..., Any] and that's that get_args() returns for that. -- ___ Python tracker

[issue40398] get_args(Callable) fails

2020-04-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : >>> from typing import * >>> get_args(Callable) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 1412, in get_args if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis: In