mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Make self and cls positional-only in dict constructor methods (#15262)
This commit is contained in:
+3
-3
@@ -1176,9 +1176,9 @@ class dict(MutableMapping[_KT, _VT]):
|
||||
# __init__ should be kept roughly in line with `collections.UserDict.__init__`, which has similar semantics
|
||||
# Also multiprocessing.managers.SyncManager.dict()
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
def __init__(self, /) -> None: ...
|
||||
@overload
|
||||
def __init__(self: dict[str, _VT], **kwargs: _VT) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780
|
||||
def __init__(self: dict[str, _VT], /, **kwargs: _VT) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780
|
||||
@overload
|
||||
def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ...
|
||||
@overload
|
||||
@@ -1203,7 +1203,7 @@ class dict(MutableMapping[_KT, _VT]):
|
||||
def __init__(self: dict[str, str], iterable: Iterable[list[str]], /) -> None: ...
|
||||
@overload
|
||||
def __init__(self: dict[bytes, bytes], iterable: Iterable[list[bytes]], /) -> None: ...
|
||||
def __new__(cls, *args: Any, **kwargs: Any) -> Self: ...
|
||||
def __new__(cls, /, *args: Any, **kwargs: Any) -> Self: ...
|
||||
def copy(self) -> dict[_KT, _VT]: ...
|
||||
def keys(self) -> dict_keys[_KT, _VT]: ...
|
||||
def values(self) -> dict_values[_KT, _VT]: ...
|
||||
|
||||
Reference in New Issue
Block a user