- Python Home
- About
- News
- Documentation
- Downloads
- Community
- Foundation
- Developer's Guide
- Issue Tracker
- Issues
- Summaries
- User
- Administration
- Help
Message367308
This issue tracker has been migrated to GitHub,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
| Author | serhiy.storchaka |
|---|---|
| Recipients | gvanrossum, levkivskyi, serhiy.storchaka |
| Date | 2020-04-26.16:02:56 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1587916977.12.0.758725068649.issue40396@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
Currently typing functions get_origin(), get_args() and get_type_hints() do not support GenericAlias.
>>> from typing import *
>>> get_origin(List[int])
<class 'list'>
>>> get_origin(list[int])
>>> get_args(List[int])
(<class 'int'>,)
>>> get_args(list[int])
()
>>> def foo(x: List[ForwardRef('X')], y: list[ForwardRef('X')]) -> None: ...
...
>>> class X: ...
...
>>> get_type_hints(foo)
{'x': typing.List[__main__.X], 'y': list[ForwardRef('X')], 'return': <class 'NoneType'>}
The proposed PR fixes this. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-04-26 16:02:57 | serhiy.storchaka | set | recipients: + serhiy.storchaka, gvanrossum, levkivskyi |
| 2020-04-26 16:02:57 | serhiy.storchaka | set | messageid: <1587916977.12.0.758725068649.issue40396@roundup.psfhosted.org> |
| 2020-04-26 16:02:57 | serhiy.storchaka | link | issue40396 messages |
| 2020-04-26 16:02:56 | serhiy.storchaka | create | |

