diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-05-24 23:35:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-24 23:35:58 (GMT) |
commit | 3b3f2e107b8b53b5feb67ca433bfca4b1d21dedf (patch) | |
tree | 85e07f7ec739221497475a6fca911e3701f31b28 /Doc | |
parent | 5e911673e4e3cbf16dfa6dd624fa7a2187b4a8a7 (diff) | |
download | cpython-3b3f2e107b8b53b5feb67ca433bfca4b1d21dedf.zip cpython-3b3f2e107b8b53b5feb67ca433bfca4b1d21dedf.tar.gz cpython-3b3f2e107b8b53b5feb67ca433bfca4b1d21dedf.tar.bz2 |
[3.11] gh-104874: Document NewType.__supertype__ (GH-104875) (#104907)
gh-104874: Document NewType.__supertype__ (GH-104875)
(cherry picked from commit 41768a2bd3a8f57e6ce4e4ae9cab083b69817ec1)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/typing.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 33cf1cb..bcf30c5 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1628,6 +1628,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 |