mirror of https://github.com/python/cpython
gh-104874: Document NewType.__supertype__ (#104875)
This commit is contained in:
parent
dbcdbf1814
commit
41768a2bd3
|
@ -1648,6 +1648,18 @@ These are not used in annotations. They are building blocks for declaring types.
|
|||
UserId = NewType('UserId', int)
|
||||
first_user = UserId(1)
|
||||
|
||||
.. attribute:: __module__
|
||||
|
||||
The module in which the new type is defined.
|
||||
|
||||
.. attribute:: __name__
|
||||
|
||||
The name of the new type.
|
||||
|
||||
.. attribute:: __supertype__
|
||||
|
||||
The type that the new type is based on.
|
||||
|
||||
.. versionadded:: 3.5.2
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Document the ``__name__`` and ``__supertype__`` attributes of
|
||||
:class:`typing.NewType`. Patch by Jelle Zijlstra.
|
Loading…
Reference in New Issue