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

@@ -89,14 +89,26 @@ class FunctionType:
__type_params__: tuple[TypeVar | ParamSpec | TypeVarTuple, ...]
__module__: str
def __new__(
cls,
code: CodeType,
globals: dict[str, Any],
name: str | None = ...,
argdefs: tuple[object, ...] | None = ...,
closure: tuple[CellType, ...] | None = ...,
) -> Self: ...
if sys.version_info >= (3, 13):
def __new__(
cls,
code: CodeType,
globals: dict[str, Any],
name: str | None = None,
argdefs: tuple[object, ...] | None = None,
closure: tuple[CellType, ...] | None = None,
kwdefaults: dict[str, object] | None = None,
) -> Self: ...
else:
def __new__(
cls,
code: CodeType,
globals: dict[str, Any],
name: str | None = None,
argdefs: tuple[object, ...] | None = None,
closure: tuple[CellType, ...] | None = None,
) -> Self: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
@overload
def __get__(self, instance: None, owner: type, /) -> FunctionType: ...
@@ -442,7 +454,7 @@ class MethodType:
def __name__(self) -> str: ... # inherited from the added function
@property
def __qualname__(self) -> str: ... # inherited from the added function
def __new__(cls, func: Callable[..., Any], obj: object, /) -> Self: ...
def __new__(cls, func: Callable[..., Any], instance: object, /) -> Self: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
@@ -604,7 +616,7 @@ if sys.version_info >= (3, 9):
def __args__(self) -> tuple[Any, ...]: ...
@property
def __parameters__(self) -> tuple[Any, ...]: ...
def __new__(cls, origin: type, args: Any) -> Self: ...
def __new__(cls, origin: type, args: Any, /) -> Self: ...
def __getitem__(self, typeargs: Any, /) -> GenericAlias: ...
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...