mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 04:04:25 +08:00
Add EllipsisType, NoneType, and NotImplementedType (Python 3.10) (#4822)
This commit is contained in:
@@ -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]: ...
|
||||
|
||||
@@ -15,6 +15,7 @@ from typing import (
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing_extensions import Literal, final
|
||||
|
||||
# ModuleType is exported from this module, but for circular import
|
||||
# reasons exists in its own stub file (with ModuleSpec and Loader).
|
||||
@@ -324,3 +325,10 @@ if sys.version_info >= (3, 9):
|
||||
__parameters__: Tuple[Any, ...]
|
||||
def __init__(self, origin: type, args: Any) -> None: ...
|
||||
def __getattr__(self, name: str) -> Any: ... # incomplete
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
@final
|
||||
class NoneType:
|
||||
def __bool__(self) -> Literal[False]: ...
|
||||
EllipsisType = ellipsis # noqa F811 from builtins
|
||||
NotImplementedType = _NotImplementedType # noqa F811 from builtins
|
||||
|
||||
Reference in New Issue
Block a user