mirror of
https://github.com/python/cpython.git
synced 2024-11-23 18:04:37 +08:00
bpo-44353: Correct docstring for NewType
(#29785)
The docstring for `typing.NewType` is no longer strictly accurate, now that `NewType` is a class, rather than a function
This commit is contained in:
parent
97dcab7832
commit
93c65df83c
@ -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…
Reference in New Issue
Block a user