mark some positional-only arguments (#4693)

https://github.com/python/mypy/pull/9626 will make stubtest a little bit
stricter about positional-only arguments for dunders like __init__

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2020-10-22 04:31:23 -07:00
committed by GitHub
parent dcbeed5b5a
commit faf827bc36
6 changed files with 7 additions and 7 deletions

View File

@@ -74,7 +74,7 @@ else:
class UserDict(MutableMapping[_KT, _VT]):
data: Dict[_KT, _VT]
def __init__(self, dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ...
def __init__(self, __dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, key: _KT) -> _VT: ...
def __setitem__(self, key: _KT, item: _VT) -> None: ...

View File

@@ -77,9 +77,9 @@ class partialmethod(Generic[_T]):
args: Tuple[Any, ...]
keywords: Dict[str, Any]
@overload
def __init__(self, func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ...
def __init__(self, __func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ...
@overload
def __init__(self, func: _Descriptor, *args: Any, **keywords: Any) -> None: ...
def __init__(self, __func: _Descriptor, *args: Any, **keywords: Any) -> None: ...
def __get__(self, obj: Any, cls: Type[Any]) -> Callable[..., _T]: ...
@property
def __isabstractmethod__(self) -> bool: ...

View File

@@ -73,7 +73,7 @@ class Base:
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
class NonCallableMock(Base, Any): # type: ignore
def __new__(cls, *args: Any, **kw: Any) -> NonCallableMock: ...
def __new__(__cls, *args: Any, **kw: Any) -> NonCallableMock: ...
def __init__(
self,
spec: Union[List[str], object, Type[object], None] = ...,