-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Closed
Closed
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Docs do not mention __type_params__ key returned value for classes and functions:
cpython/Doc/library/inspect.rst
Lines 47 to 58 in a18c985
| +===========+===================+===========================+ | |
| | class | __doc__ | documentation string | | |
| +-----------+-------------------+---------------------------+ | |
| | | __name__ | name with which this | | |
| | | | class was defined | | |
| +-----------+-------------------+---------------------------+ | |
| | | __qualname__ | qualified name | | |
| +-----------+-------------------+---------------------------+ | |
| | | __module__ | name of module in which | | |
| | | | this class was defined | | |
| +-----------+-------------------+---------------------------+ | |
| | method | __doc__ | documentation string | |
cpython/Doc/library/inspect.rst
Lines 75 to 109 in a18c985
| +-----------+-------------------+---------------------------+ | |
| | function | __doc__ | documentation string | | |
| +-----------+-------------------+---------------------------+ | |
| | | __name__ | name with which this | | |
| | | | function was defined | | |
| +-----------+-------------------+---------------------------+ | |
| | | __qualname__ | qualified name | | |
| +-----------+-------------------+---------------------------+ | |
| | | __code__ | code object containing | | |
| | | | compiled function | | |
| | | | :term:`bytecode` | | |
| +-----------+-------------------+---------------------------+ | |
| | | __defaults__ | tuple of any default | | |
| | | | values for positional or | | |
| | | | keyword parameters | | |
| +-----------+-------------------+---------------------------+ | |
| | | __kwdefaults__ | mapping of any default | | |
| | | | values for keyword-only | | |
| | | | parameters | | |
| +-----------+-------------------+---------------------------+ | |
| | | __globals__ | global namespace in which | | |
| | | | this function was defined | | |
| +-----------+-------------------+---------------------------+ | |
| | | __builtins__ | builtins namespace | | |
| +-----------+-------------------+---------------------------+ | |
| | | __annotations__ | mapping of parameters | | |
| | | | names to annotations; | | |
| | | | ``"return"`` key is | | |
| | | | reserved for return | | |
| | | | annotations. | | |
| +-----------+-------------------+---------------------------+ | |
| | | __module__ | name of module in which | | |
| | | | this function was defined | | |
| +-----------+-------------------+---------------------------+ | |
| | traceback | tb_frame | frame object at this | |
But, they are returned:
>>> class A[T]: ...
...
>>> import inspect
>>> dict(inspect.getmembers(A))['__type_params__']
(T,)I will send a PR for that.
Linked PRs
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error