mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Move ellipsis definition to types (#11223)
This commit is contained in:
@@ -1914,9 +1914,13 @@ def __import__(
|
||||
def __build_class__(__func: Callable[[], _Cell | Any], __name: str, *bases: Any, metaclass: Any = ..., **kwds: Any) -> Any: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
# In Python 3.10, EllipsisType is exposed publicly in the types module.
|
||||
@final
|
||||
class ellipsis: ...
|
||||
from types import EllipsisType
|
||||
|
||||
# Backwards compatibility hack for folks who relied on the ellipsis type
|
||||
# existing in typeshed in Python 3.9 and earlier.
|
||||
ellipsis = EllipsisType
|
||||
|
||||
Ellipsis: EllipsisType
|
||||
|
||||
else:
|
||||
# Actually the type of Ellipsis is <type 'ellipsis'>, but since it's
|
||||
@@ -1925,7 +1929,7 @@ else:
|
||||
@type_check_only
|
||||
class ellipsis: ...
|
||||
|
||||
Ellipsis: ellipsis
|
||||
Ellipsis: ellipsis
|
||||
|
||||
class BaseException:
|
||||
args: tuple[Any, ...]
|
||||
|
||||
@@ -626,7 +626,10 @@ if sys.version_info >= (3, 10):
|
||||
@final
|
||||
class NoneType:
|
||||
def __bool__(self) -> Literal[False]: ...
|
||||
EllipsisType = ellipsis # noqa: F821 from builtins
|
||||
|
||||
@final
|
||||
class EllipsisType: ...
|
||||
|
||||
from builtins import _NotImplementedType
|
||||
|
||||
NotImplementedType = _NotImplementedType
|
||||
|
||||
Reference in New Issue
Block a user