@@ -385,7 +385,8 @@ else:
385
385
def __ge__ (self , x : unicode ) -> bool : ...
386
386
387
387
def __len__ (self ) -> int : ...
388
- def __contains__ (self , s : object ) -> bool : ...
388
+ # The argument type is incompatible with Sequence
389
+ def __contains__ (self , s : Union [unicode , bytes ]) -> bool : ... # type: ignore
389
390
def __iter__ (self ) -> Iterator [unicode ]: ...
390
391
def __str__ (self ) -> str : ...
391
392
def __repr__ (self ) -> str : ...
@@ -520,7 +521,8 @@ class str(Sequence[str], _str_base):
520
521
def __add__ (self , s : str ) -> str : ...
521
522
else :
522
523
def __add__ (self , s : AnyStr ) -> AnyStr : ...
523
- def __contains__ (self , o : object ) -> bool : ...
524
+ # Incompatible with Sequence.__contains__
525
+ def __contains__ (self , o : Union [str , Text ]) -> bool : ... # type: ignore
524
526
def __eq__ (self , x : object ) -> bool : ...
525
527
def __ge__ (self , x : Text ) -> bool : ...
526
528
def __getitem__ (self , i : Union [int , slice ]) -> str : ...
@@ -622,7 +624,8 @@ if sys.version_info >= (3,):
622
624
def __rmul__ (self , n : int ) -> bytes : ...
623
625
if sys .version_info >= (3 , 5 ):
624
626
def __mod__ (self , value : Any ) -> bytes : ...
625
- def __contains__ (self , o : object ) -> bool : ...
627
+ # Incompatible with Sequence.__contains__
628
+ def __contains__ (self , o : Union [int , bytes ]) -> bool : ... # type: ignore
626
629
def __eq__ (self , x : object ) -> bool : ...
627
630
def __ne__ (self , x : object ) -> bool : ...
628
631
def __lt__ (self , x : bytes ) -> bool : ...
@@ -754,7 +757,8 @@ class bytearray(MutableSequence[int], ByteString):
754
757
def __imul__ (self , n : int ) -> bytearray : ...
755
758
if sys .version_info >= (3 , 5 ):
756
759
def __mod__ (self , value : Any ) -> bytes : ...
757
- def __contains__ (self , o : object ) -> bool : ...
760
+ # Incompatible with Sequence.__contains__
761
+ def __contains__ (self , o : Union [int , bytes ]) -> bool : ... # type: ignore
758
762
def __eq__ (self , x : object ) -> bool : ...
759
763
def __ne__ (self , x : object ) -> bool : ...
760
764
def __lt__ (self , x : bytes ) -> bool : ...
0 commit comments