]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44353: Correct docstring for `NewType` (GH-29785)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 26 Nov 2021 14:58:13 +0000 (06:58 -0800)
committerGitHub <noreply@github.com>
Fri, 26 Nov 2021 14:58:13 +0000 (06:58 -0800)
The docstring for `typing.NewType` is no longer strictly accurate, now that `NewType` is a class, rather than a function
(cherry picked from commit 93c65df83cef71a4bc77d71afecdec8744c4f73a)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Lib/typing.py

index 21caabb5d3e6770c98e40bd1ddc059fd3572a181..b743d400c0e5fa0f5c4186dbf385983d50d3b46b 100644 (file)
@@ -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)