Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.

Commit 2491774

Browse files
committed
fix NoneType
1 parent dbca1a2 commit 2491774

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

stdlib/_typeshed/__init__.pyi

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,10 @@ ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, TracebackType]
203203
OptExcInfo: TypeAlias = Union[ExcInfo, tuple[None, None, None]]
204204

205205
# stable
206-
if sys.version_info >= (3, 10):
207-
from types import NoneType as NoneType
208-
else:
209-
# Used by type checkers for checks involving None (does not exist at runtime)
210-
@final
211-
class NoneType:
212-
def __bool__(self) -> Literal[False]: ...
206+
# Used by type checkers for checks involving None (does not exist at runtime)
207+
@final
208+
class NoneType:
209+
def __bool__(self) -> Literal[False]: ...
213210

214211
# This is an internal CPython type that is like, but subtly different from, a NamedTuple
215212
# Subclasses of this type are found in multiple modules.

stdlib/types.pyi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,10 +654,8 @@ if sys.version_info >= (3, 9):
654654
def __getattr__(self, name: str) -> Any: ... # incomplete
655655

656656
if sys.version_info >= (3, 10):
657-
@final
658-
class NoneType:
659-
def __bool__(self) -> Literal[False]: ...
660-
EllipsisType = ellipsis # noqa: F821 from builtins
657+
NoneType = type(None)
658+
EllipsisType = ellipsis # noqa: F811 from builtins
661659
from builtins import _NotImplementedType
662660

663661
NotImplementedType = _NotImplementedType

0 commit comments

Comments
 (0)