1
1
import sys
2
- from _typeshed import Self
3
2
from collections .abc import Iterable , Iterator , MutableSet
4
3
from typing import Any , Generic , TypeVar , overload
4
+ from typing_extensions import Self
5
5
6
6
if sys .version_info >= (3 , 9 ):
7
7
from types import GenericAlias
@@ -18,21 +18,21 @@ class WeakSet(MutableSet[_T], Generic[_T]):
18
18
def __init__ (self , data : Iterable [_T ]) -> None : ...
19
19
def add (self , item : _T ) -> None : ...
20
20
def discard (self , item : _T ) -> None : ...
21
- def copy (self : Self ) -> Self : ...
21
+ def copy (self ) -> Self : ...
22
22
def remove (self , item : _T ) -> None : ...
23
23
def update (self , other : Iterable [_T ]) -> None : ...
24
24
def __contains__ (self , item : object ) -> bool : ...
25
25
def __len__ (self ) -> int : ...
26
26
def __iter__ (self ) -> Iterator [_T ]: ...
27
- def __ior__ (self : Self , other : Iterable [_T ]) -> Self : ... # type: ignore[override,misc]
28
- def difference (self : Self , other : Iterable [_T ]) -> Self : ...
29
- def __sub__ (self : Self , other : Iterable [Any ]) -> Self : ...
27
+ def __ior__ (self , other : Iterable [_T ]) -> Self : ... # type: ignore[override,misc]
28
+ def difference (self , other : Iterable [_T ]) -> Self : ...
29
+ def __sub__ (self , other : Iterable [Any ]) -> Self : ...
30
30
def difference_update (self , other : Iterable [Any ]) -> None : ...
31
- def __isub__ (self : Self , other : Iterable [Any ]) -> Self : ...
32
- def intersection (self : Self , other : Iterable [_T ]) -> Self : ...
33
- def __and__ (self : Self , other : Iterable [Any ]) -> Self : ...
31
+ def __isub__ (self , other : Iterable [Any ]) -> Self : ...
32
+ def intersection (self , other : Iterable [_T ]) -> Self : ...
33
+ def __and__ (self , other : Iterable [Any ]) -> Self : ...
34
34
def intersection_update (self , other : Iterable [Any ]) -> None : ...
35
- def __iand__ (self : Self , other : Iterable [Any ]) -> Self : ...
35
+ def __iand__ (self , other : Iterable [Any ]) -> Self : ...
36
36
def issubset (self , other : Iterable [_T ]) -> bool : ...
37
37
def __le__ (self , other : Iterable [_T ]) -> bool : ...
38
38
def __lt__ (self , other : Iterable [_T ]) -> bool : ...
@@ -43,7 +43,7 @@ class WeakSet(MutableSet[_T], Generic[_T]):
43
43
def symmetric_difference (self , other : Iterable [_S ]) -> WeakSet [_S | _T ]: ...
44
44
def __xor__ (self , other : Iterable [_S ]) -> WeakSet [_S | _T ]: ...
45
45
def symmetric_difference_update (self , other : Iterable [_T ]) -> None : ...
46
- def __ixor__ (self : Self , other : Iterable [_T ]) -> Self : ... # type: ignore[override,misc]
46
+ def __ixor__ (self , other : Iterable [_T ]) -> Self : ... # type: ignore[override,misc]
47
47
def union (self , other : Iterable [_S ]) -> WeakSet [_S | _T ]: ...
48
48
def __or__ (self , other : Iterable [_S ]) -> WeakSet [_S | _T ]: ...
49
49
def isdisjoint (self , other : Iterable [_T ]) -> bool : ...
0 commit comments