mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-30 08:04:24 +08:00
Clean up stubtest allowlist for typing (#10205)
This commit is contained in:
@@ -211,6 +211,7 @@ if sys.version_info >= (3, 11):
|
||||
NotRequired: _SpecialForm
|
||||
LiteralString: _SpecialForm
|
||||
|
||||
@_final
|
||||
class TypeVarTuple:
|
||||
@property
|
||||
def __name__(self) -> str: ...
|
||||
@@ -220,16 +221,19 @@ if sys.version_info >= (3, 11):
|
||||
def __typing_prepare_subst__(self, alias: Incomplete, args: Incomplete) -> Incomplete: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
@_final
|
||||
class ParamSpecArgs:
|
||||
@property
|
||||
def __origin__(self) -> ParamSpec: ...
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
|
||||
@_final
|
||||
class ParamSpecKwargs:
|
||||
@property
|
||||
def __origin__(self) -> ParamSpec: ...
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
|
||||
@_final
|
||||
class ParamSpec:
|
||||
@property
|
||||
def __name__(self) -> str: ...
|
||||
@@ -272,7 +276,7 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
class NewType:
|
||||
def __init__(self, name: str, tp: Any) -> None: ...
|
||||
def __call__(self, x: _T) -> _T: ...
|
||||
def __call__(self, __x: _T) -> _T: ...
|
||||
def __or__(self, other: Any) -> _SpecialForm: ...
|
||||
def __ror__(self, other: Any) -> _SpecialForm: ...
|
||||
__supertype__: type
|
||||
|
||||
@@ -22,7 +22,6 @@ from typing import ( # noqa: Y022,Y039
|
||||
DefaultDict as DefaultDict,
|
||||
Deque as Deque,
|
||||
Mapping,
|
||||
NewType as NewType,
|
||||
NoReturn as NoReturn,
|
||||
Sequence,
|
||||
SupportsAbs as SupportsAbs,
|
||||
@@ -97,6 +96,7 @@ __all__ = [
|
||||
"runtime_checkable",
|
||||
"Text",
|
||||
"TypeAlias",
|
||||
"TypeAliasType",
|
||||
"TypeGuard",
|
||||
"TYPE_CHECKING",
|
||||
"Never",
|
||||
@@ -106,6 +106,7 @@ __all__ = [
|
||||
"clear_overloads",
|
||||
"get_args",
|
||||
"get_origin",
|
||||
"get_original_bases",
|
||||
"get_overloads",
|
||||
"get_type_hints",
|
||||
]
|
||||
@@ -196,10 +197,11 @@ class SupportsIndex(Protocol, metaclass=abc.ABCMeta):
|
||||
@abc.abstractmethod
|
||||
def __index__(self) -> int: ...
|
||||
|
||||
# New things in 3.10
|
||||
# New and changed things in 3.10
|
||||
if sys.version_info >= (3, 10):
|
||||
from typing import (
|
||||
Concatenate as Concatenate,
|
||||
NewType as NewType,
|
||||
ParamSpecArgs as ParamSpecArgs,
|
||||
ParamSpecKwargs as ParamSpecKwargs,
|
||||
TypeAlias as TypeAlias,
|
||||
@@ -207,12 +209,16 @@ if sys.version_info >= (3, 10):
|
||||
is_typeddict as is_typeddict,
|
||||
)
|
||||
else:
|
||||
@final
|
||||
class ParamSpecArgs:
|
||||
__origin__: ParamSpec
|
||||
@property
|
||||
def __origin__(self) -> ParamSpec: ...
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
|
||||
@final
|
||||
class ParamSpecKwargs:
|
||||
__origin__: ParamSpec
|
||||
@property
|
||||
def __origin__(self) -> ParamSpec: ...
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
|
||||
Concatenate: _SpecialForm
|
||||
@@ -220,6 +226,11 @@ else:
|
||||
TypeGuard: _SpecialForm
|
||||
def is_typeddict(tp: object) -> bool: ...
|
||||
|
||||
class NewType:
|
||||
def __init__(self, name: str, tp: Any) -> None: ...
|
||||
def __call__(self, __x: _T) -> _T: ...
|
||||
__supertype__: type
|
||||
|
||||
# New things in 3.11
|
||||
# NamedTuples are not new, but the ability to create generic NamedTuples is new in 3.11
|
||||
if sys.version_info >= (3, 11):
|
||||
|
||||
Reference in New Issue
Block a user