[issue32752] no information about accessing typing.Generic type arguments
New submission from Paul Pinterits
list_of_ints = typing.List[int]
# how do we get
out of list_of_ints? list_of_ints.???
Through trial and error I've discovered list_of_ints.__args__, which *seems* to be what I'm looking for, but since it's never mentioned in the docs, it's unclear whether this __args__ attribute is an implementation detail or not.
Please document the official/intended way to extract type arguments from a Generic.
----------
assignee: docs@python
components: Documentation
messages: 311520
nosy: Paul Pinterits, docs@python
priority: normal
severity: normal
status: open
title: no information about accessing typing.Generic type arguments
type: enhancement
versions: Python 3.5, Python 3.6
_______________________________________
Python tracker
participants (6)
-
Guido van Rossum
-
Ivan Levkivskyi
-
Jared Deckard
-
Jelle Zijlstra
-
Paul Pinterits
-
Stéphane Wirtel