fix the __init__ of several C-classes (#13211)

This commit is contained in:
Stephen Morton
2024-12-23 10:55:51 -08:00
committed by GitHub
parent bfb9a91950
commit 17408ee538
23 changed files with 160 additions and 111 deletions

View File

@@ -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