mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
fix the __init__ of several C-classes (#13211)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user