Skip to content

Commit

Permalink
builtins: Fix unconstrained overloads in set() and frozenset()
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra authored May 25, 2022
1 parent 54e11a1 commit 0e50e8b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ class list(MutableSequence[_T], Generic[_T]):
class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
# __init__ should be kept roughly in line with `collections.UserDict.__init__`, which has similar semantics
@overload
def __init__(self: dict[_KT, _VT]) -> None: ...
def __init__(self) -> None: ...
@overload
def __init__(self: dict[str, _VT], **kwargs: _VT) -> None: ...
@overload
Expand Down Expand Up @@ -962,6 +962,9 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def __ior__(self: Self, __value: Iterable[tuple[_KT, _VT]]) -> Self: ...

class set(MutableSet[_T], Generic[_T]):
@overload
def __init__(self) -> None: ...
@overload
def __init__(self, __iterable: Iterable[_T] = ...) -> None: ...
def add(self, __element: _T) -> None: ...
def copy(self) -> set[_T]: ...
Expand Down Expand Up @@ -998,6 +1001,9 @@ class set(MutableSet[_T], Generic[_T]):
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...

class frozenset(AbstractSet[_T_co], Generic[_T_co]):
@overload
def __init__(self) -> None: ...
@overload
def __init__(self, __iterable: Iterable[_T_co] = ...) -> None: ...
def copy(self) -> frozenset[_T_co]: ...
def difference(self, *s: Iterable[object]) -> frozenset[_T_co]: ...
Expand Down

0 comments on commit 0e50e8b

Please sign in to comment.