Skip to content

Commit faf827b

Browse files
authored
mark some positional-only arguments (#4693)
python/mypy#9626 will make stubtest a little bit stricter about positional-only arguments for dunders like __init__ Co-authored-by: hauntsaninja <>
1 parent dcbeed5 commit faf827b

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

stdlib/2and3/weakref.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
111111

112112
if sys.version_info >= (3, 4):
113113
class finalize:
114-
def __init__(self, obj: _S, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ...
114+
def __init__(self, __obj: _S, __func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ...
115115
def __call__(self, _: Any = ...) -> Optional[_T]: ...
116116
def detach(self) -> Optional[Tuple[_S, _T, Tuple[Any, ...], Dict[str, Any]]]: ...
117117
def peek(self) -> Optional[Tuple[_S, _T, Tuple[Any, ...], Dict[str, Any]]]: ...

stdlib/3.7/_py_abc.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ _T = TypeVar("_T")
66
def get_cache_token() -> object: ...
77

88
class ABCMeta(type):
9-
def __new__(cls, __name: str, __bases: Tuple[Type[Any], ...], __namespace: Dict[str, Any]) -> ABCMeta: ...
9+
def __new__(__mcls, __name: str, __bases: Tuple[Type[Any], ...], __namespace: Dict[str, Any]) -> ABCMeta: ...
1010
def register(cls, subclass: Type[_T]) -> Type[_T]: ...

stdlib/3/collections/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ else:
7474

7575
class UserDict(MutableMapping[_KT, _VT]):
7676
data: Dict[_KT, _VT]
77-
def __init__(self, dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ...
77+
def __init__(self, __dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ...
7878
def __len__(self) -> int: ...
7979
def __getitem__(self, key: _KT) -> _VT: ...
8080
def __setitem__(self, key: _KT, item: _VT) -> None: ...

stdlib/3/functools.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ class partialmethod(Generic[_T]):
7777
args: Tuple[Any, ...]
7878
keywords: Dict[str, Any]
7979
@overload
80-
def __init__(self, func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ...
80+
def __init__(self, __func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ...
8181
@overload
82-
def __init__(self, func: _Descriptor, *args: Any, **keywords: Any) -> None: ...
82+
def __init__(self, __func: _Descriptor, *args: Any, **keywords: Any) -> None: ...
8383
def __get__(self, obj: Any, cls: Type[Any]) -> Callable[..., _T]: ...
8484
@property
8585
def __isabstractmethod__(self) -> bool: ...

stdlib/3/unittest/mock.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Base:
7373
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
7474

7575
class NonCallableMock(Base, Any): # type: ignore
76-
def __new__(cls, *args: Any, **kw: Any) -> NonCallableMock: ...
76+
def __new__(__cls, *args: Any, **kw: Any) -> NonCallableMock: ...
7777
def __init__(
7878
self,
7979
spec: Union[List[str], object, Type[object], None] = ...,

third_party/2and3/mock.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Base:
7373
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
7474

7575
class NonCallableMock(Base, Any): # type: ignore
76-
def __new__(cls, *args: Any, **kw: Any) -> NonCallableMock: ...
76+
def __new__(__cls, *args: Any, **kw: Any) -> NonCallableMock: ...
7777
def __init__(
7878
self,
7979
spec: Union[List[str], object, Type[object], None] = ...,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy