Skip to content

Commit ecb4314

Browse files
authored
builtins: NotImplemented is not callable (#4222)
Fixes #3315 Co-authored-by: hauntsaninja <>
1 parent 44a852d commit ecb4314

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

‎stdlib/2/__builtin__.pyi‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,12 @@ class property(object):
11631163
if sys.version_info < (3,):
11641164
long = int
11651165

1166-
NotImplemented: Any
1166+
class _NotImplementedType(Any): # type: ignore
1167+
# A little weird, but typing the __call__ as NotImplemented makes the error message
1168+
# for NotImplemented() much better
1169+
__call__: NotImplemented # type: ignore
1170+
1171+
NotImplemented: _NotImplementedType
11671172

11681173
def abs(__x: SupportsAbs[_T]) -> _T: ...
11691174
def all(__iterable: Iterable[object]) -> bool: ...

‎stdlib/2and3/builtins.pyi‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,12 @@ class property(object):
11631163
if sys.version_info < (3,):
11641164
long = int
11651165

1166-
NotImplemented: Any
1166+
class _NotImplementedType(Any): # type: ignore
1167+
# A little weird, but typing the __call__ as NotImplemented makes the error message
1168+
# for NotImplemented() much better
1169+
__call__: NotImplemented # type: ignore
1170+
1171+
NotImplemented: _NotImplementedType
11671172

11681173
def abs(__x: SupportsAbs[_T]) -> _T: ...
11691174
def all(__iterable: Iterable[object]) -> bool: ...

0 commit comments

Comments
 (0)