mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-29 23:26:54 +08:00
stdlib: Add defaults for positional-only parameters (#9655)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user