]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44353: Correct docstring for `NewType` (#29785)
authorAlex Waygood <Alex.Waygood@Gmail.com>
Fri, 26 Nov 2021 04:55:15 +0000 (04:55 +0000)
committerGitHub <noreply@github.com>
Fri, 26 Nov 2021 04:55:15 +0000 (20:55 -0800)
The docstring for `typing.NewType` is no longer strictly accurate, now that `NewType` is a class, rather than a function

Lib/typing.py

index 031aa24eaf44205c06350b0b7b8591f22f2fa8f1..bdd19cadb471a674674897460a5b3109f93d0914 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)