Move NotImplementedType to types.pyi (#14966)

This commit is contained in:
Randolf Scholz
2025-11-02 15:00:52 +01:00
committed by GitHub
parent 8aaa86f6a4
commit 7fde97036f
3 changed files with 26 additions and 12 deletions
+9 -9
View File
@@ -1367,13 +1367,6 @@ class property:
def __set__(self, instance: Any, value: Any, /) -> None: ...
def __delete__(self, instance: Any, /) -> None: ...
@final
@type_check_only
class _NotImplementedType(Any):
__call__: None
NotImplemented: _NotImplementedType
def abs(x: SupportsAbs[_T], /) -> _T: ...
def all(iterable: Iterable[object], /) -> bool: ...
def any(iterable: Iterable[object], /) -> bool: ...
@@ -2032,14 +2025,14 @@ def __import__(
def __build_class__(func: Callable[[], CellType | Any], name: str, /, *bases: Any, metaclass: Any = ..., **kwds: Any) -> Any: ...
if sys.version_info >= (3, 10):
from types import EllipsisType
from types import EllipsisType, NotImplementedType
# Backwards compatibility hack for folks who relied on the ellipsis type
# existing in typeshed in Python 3.9 and earlier.
ellipsis = EllipsisType
Ellipsis: EllipsisType
NotImplemented: NotImplementedType
else:
# Actually the type of Ellipsis is <type 'ellipsis'>, but since it's
# not exposed anywhere under that name, we make it private here.
@@ -2049,6 +2042,13 @@ else:
Ellipsis: ellipsis
@final
@type_check_only
class _NotImplementedType(Any):
__call__: None
NotImplemented: _NotImplementedType
@disjoint_base
class BaseException:
args: tuple[Any, ...]