mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
bpo-44353: Correct docstring for NewType
(GH-29785)
The docstring for `typing.NewType` is no longer strictly accurate, now that `NewType` is a class, rather than a function
(cherry picked from commit 93c65df83c
)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
7842aed7a7
commit
3f024e27c2
1 changed files with 1 additions and 1 deletions
|
@ -2427,7 +2427,7 @@ class NewType:
|
|||
"""NewType creates simple unique types with almost zero
|
||||
runtime overhead. NewType(name, tp) is considered a subtype of tp
|
||||
by static type checkers. At runtime, NewType(name, tp) returns
|
||||
a dummy function that simply returns its argument. Usage::
|
||||
a dummy callable that simply returns its argument. Usage::
|
||||
|
||||
UserId = NewType('UserId', int)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue