[issue32752] no information about accessing typing.Generic type arguments

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: We have typing.get_args() as of 3.8. -- nosy: +Jelle Zijlstra resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue32752] no information about accessing typing.Generic type arguments

2018-08-01 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > 3.7 is less convenient and less consistent Taking into account that internal API is something one should never use, I don't think these terms apply here. Anyway, we will provide some helpers for external use in one of the next releases. --

[issue32752] no information about accessing typing.Generic type arguments

2018-07-23 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32752] no information about accessing typing.Generic type arguments

2018-07-23 Thread Jared Deckard
Jared Deckard added the comment: typing_inspect is now filled with python version checks for 3.7. The implementation got significantly more complex when differentiating generics at runtime. 3.6 was undocumented, but the OO API was intuitive: >>> T = typing.Union[int, float] >>> assert

[issue32752] no information about accessing typing.Generic type arguments

2018-02-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: There is a third party library on PyPI called typing_inspect that provides thin wrappers around internal APIs to get lots of useful information about generics and other special types in typing. If there will be more requests like this,

[issue32752] no information about accessing typing.Generic type arguments

2018-02-05 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: with the help command, you have a good documentation, help(list_of_ints), but you are right, there is no functions/methods for your need. in the code of typing, there is a comment about __args__ but it is not used by the documentation.

[issue32752] no information about accessing typing.Generic type arguments

2018-02-02 Thread Paul Pinterits
New submission from Paul Pinterits : The documentation of the typing module explains how to instantiate generic types, but there is no information about how to extract the type arguments from a generic type. Example: >>> list_of_ints = typing.List[int] >>> >>> # how do we