From 93d8cb7fd29b59241779a28b392c8aeef842a7e3 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 26 Nov 2021 00:36:29 +0000 Subject: [PATCH] Correct docstring for `NewType` The docstring for `typing.NewType` is no longer strictly accurate, now that `NewType` is a class, rather than a function --- Lib/typing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/typing.py b/Lib/typing.py index 031aa24eaf4420..bdd19cadb471a6 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -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)