Add EllipsisType, NoneType, and NotImplementedType (Python 3.10) (#4822)

This commit is contained in:
Sebastian Rittau
2020-12-14 18:38:35 +01:00
committed by GitHub
parent e5d3a47632
commit 1c6ac09b82
2 changed files with 15 additions and 4 deletions

View File

@@ -170,7 +170,10 @@ else:
ReadableBuffer = Union[bytes, bytearray, memoryview, array.array, mmap.mmap, buffer]
WriteableBuffer = Union[bytearray, memoryview, array.array, mmap.mmap, buffer]
# Used by type checkers for checks involving None (does not exist at runtime)
@final
class NoneType:
def __bool__(self) -> Literal[False]: ...
if sys.version_info >= (3, 10):
from types import NoneType as NoneType
else:
# Used by type checkers for checks involving None (does not exist at runtime)
@final
class NoneType:
def __bool__(self) -> Literal[False]: ...