Improve __enter__ & constructor methods (#7114)

This commit is contained in:
Alex Waygood
2022-02-02 21:14:59 +00:00
committed by GitHub
parent 7ccbbdb30a
commit b4e97a1909
11 changed files with 39 additions and 21 deletions

View File

@@ -1,3 +1,4 @@
from _typeshed import Self
from collections.abc import Callable, Mapping, Sequence
from typing import Any, Generic, TypeVar, overload
from typing_extensions import Literal
@@ -33,8 +34,13 @@ DEFAULT: Any
class _Call(tuple[Any, ...]):
def __new__(
cls, value: Any = ..., name: Any | None = ..., parent: Any | None = ..., two: bool = ..., from_kall: bool = ...
) -> Any: ...
cls: type[Self],
value: Any = ...,
name: Any | None = ...,
parent: Any | None = ...,
two: bool = ...,
from_kall: bool = ...,
) -> Self: ...
name: Any
parent: Any
from_kall: Any
@@ -60,7 +66,7 @@ class Base:
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
class NonCallableMock(Base, Any):
def __new__(__cls, *args: Any, **kw: Any) -> NonCallableMock: ...
def __new__(__cls: type[Self], *args: Any, **kw: Any) -> Self: ...
def __init__(
self,
spec: list[str] | object | type[object] | None = ...,