stdlib: Add defaults for positional-only parameters (#9655)

This commit is contained in:
Alex Waygood
2023-02-01 21:44:08 +00:00
committed by GitHub
parent 35172c7aab
commit 1d7dda7fa1
30 changed files with 159 additions and 155 deletions

View File

@@ -49,9 +49,9 @@ class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
data: dict[_KT, _VT]
# __init__ should be kept roughly in line with `dict.__init__`, which has the same semantics
@overload
def __init__(self, __dict: None = ...) -> None: ...
def __init__(self, __dict: None = None) -> None: ...
@overload
def __init__(self: UserDict[str, _VT], __dict: None = ..., **kwargs: _VT) -> None: ...
def __init__(self: UserDict[str, _VT], __dict: None = None, **kwargs: _VT) -> None: ...
@overload
def __init__(self, __dict: SupportsKeysAndGetItem[_KT, _VT]) -> None: ...
@overload
@@ -254,9 +254,9 @@ class deque(MutableSequence[_T], Generic[_T]):
class Counter(dict[_T, int], Generic[_T]):
@overload
def __init__(self, __iterable: None = ...) -> None: ...
def __init__(self, __iterable: None = None) -> None: ...
@overload
def __init__(self: Counter[str], __iterable: None = ..., **kwargs: int) -> None: ...
def __init__(self: Counter[str], __iterable: None = None, **kwargs: int) -> None: ...
@overload
def __init__(self, __mapping: SupportsKeysAndGetItem[_T, int]) -> None: ...
@overload
@@ -267,7 +267,7 @@ class Counter(dict[_T, int], Generic[_T]):
@classmethod
def fromkeys(cls, iterable: Any, v: int | None = None) -> NoReturn: ... # type: ignore[override]
@overload
def subtract(self, __iterable: None = ...) -> None: ...
def subtract(self, __iterable: None = None) -> None: ...
@overload
def subtract(self, __mapping: Mapping[_T, int]) -> None: ...
@overload