mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 02:41:16 +08:00
fix the __init__ of several C-classes (#13211)
This commit is contained in:
@@ -155,8 +155,8 @@ class TypeVar:
|
||||
@property
|
||||
def __default__(self) -> Any: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def __init__(
|
||||
self,
|
||||
def __new__(
|
||||
cls,
|
||||
name: str,
|
||||
*constraints: Any,
|
||||
bound: Any | None = None,
|
||||
@@ -164,17 +164,21 @@ class TypeVar:
|
||||
covariant: bool = False,
|
||||
infer_variance: bool = False,
|
||||
default: Any = ...,
|
||||
) -> None: ...
|
||||
) -> Self: ...
|
||||
elif sys.version_info >= (3, 12):
|
||||
def __init__(
|
||||
self,
|
||||
def __new__(
|
||||
cls,
|
||||
name: str,
|
||||
*constraints: Any,
|
||||
bound: Any | None = None,
|
||||
covariant: bool = False,
|
||||
contravariant: bool = False,
|
||||
infer_variance: bool = False,
|
||||
) -> None: ...
|
||||
) -> Self: ...
|
||||
elif sys.version_info >= (3, 11):
|
||||
def __new__(
|
||||
cls, name: str, *constraints: Any, bound: Any | None = None, covariant: bool = False, contravariant: bool = False
|
||||
) -> Self: ...
|
||||
else:
|
||||
def __init__(
|
||||
self, name: str, *constraints: Any, bound: Any | None = None, covariant: bool = False, contravariant: bool = False
|
||||
@@ -232,7 +236,9 @@ if sys.version_info >= (3, 11):
|
||||
def __default__(self) -> Any: ...
|
||||
def has_default(self) -> bool: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def __init__(self, name: str, *, default: Any = ...) -> None: ...
|
||||
def __new__(cls, name: str, *, default: Any = ...) -> Self: ...
|
||||
elif sys.version_info >= (3, 12):
|
||||
def __new__(cls, name: str) -> Self: ...
|
||||
else:
|
||||
def __init__(self, name: str) -> None: ...
|
||||
|
||||
@@ -245,14 +251,22 @@ if sys.version_info >= (3, 10):
|
||||
class ParamSpecArgs:
|
||||
@property
|
||||
def __origin__(self) -> ParamSpec: ...
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
if sys.version_info >= (3, 12):
|
||||
def __new__(cls, origin: ParamSpec) -> Self: ...
|
||||
else:
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
@final
|
||||
class ParamSpecKwargs:
|
||||
@property
|
||||
def __origin__(self) -> ParamSpec: ...
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
if sys.version_info >= (3, 12):
|
||||
def __new__(cls, origin: ParamSpec) -> Self: ...
|
||||
else:
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
@final
|
||||
@@ -272,8 +286,8 @@ if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def __default__(self) -> Any: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def __init__(
|
||||
self,
|
||||
def __new__(
|
||||
cls,
|
||||
name: str,
|
||||
*,
|
||||
bound: Any | None = None,
|
||||
@@ -281,17 +295,21 @@ if sys.version_info >= (3, 10):
|
||||
covariant: bool = False,
|
||||
infer_variance: bool = False,
|
||||
default: Any = ...,
|
||||
) -> None: ...
|
||||
) -> Self: ...
|
||||
elif sys.version_info >= (3, 12):
|
||||
def __init__(
|
||||
self,
|
||||
def __new__(
|
||||
cls,
|
||||
name: str,
|
||||
*,
|
||||
bound: Any | None = None,
|
||||
contravariant: bool = False,
|
||||
covariant: bool = False,
|
||||
infer_variance: bool = False,
|
||||
) -> None: ...
|
||||
) -> Self: ...
|
||||
elif sys.version_info >= (3, 11):
|
||||
def __new__(
|
||||
cls, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False
|
||||
) -> Self: ...
|
||||
else:
|
||||
def __init__(
|
||||
self, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False
|
||||
@@ -1039,9 +1057,7 @@ if sys.version_info >= (3, 12):
|
||||
def override(method: _F, /) -> _F: ...
|
||||
@final
|
||||
class TypeAliasType:
|
||||
def __init__(
|
||||
self, name: str, value: Any, *, type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] = ()
|
||||
) -> None: ...
|
||||
def __new__(cls, name: str, value: Any, *, type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] = ()) -> Self: ...
|
||||
@property
|
||||
def __value__(self) -> Any: ...
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user