Skip to content

Commit 3f024e2

Browse files
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 93c65df) Co-authored-by: Alex Waygood <[email protected]>
1 parent 7842aed commit 3f024e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2427,7 +2427,7 @@ class NewType:
24272427
"""NewType creates simple unique types with almost zero
24282428
runtime overhead. NewType(name, tp) is considered a subtype of tp
24292429
by static type checkers. At runtime, NewType(name, tp) returns
2430-
a dummy function that simply returns its argument. Usage::
2430+
a dummy callable that simply returns its argument. Usage::
24312431
24322432
UserId = NewType('UserId', int)
24332433

0 commit comments

Comments
 (0)