mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
add bytes.__mod__ (#1212)
Fixes python/mypy#3247 Also reviewed some related logic: - __mod__ was added to both bytes and bytearray with PEP 461, which went into 3.5 - str.__mod__ takes only one argument, and the signature calls it "value" - In Python 2, bytearray doesn't have __mod__ (and typeshed correctly omits it)
This commit is contained in:
committed by
Matthias Kramm
parent
c133a3aca7
commit
d1da44dc1b
@@ -287,7 +287,7 @@ class str(Sequence[str]):
|
||||
def __add__(self, s: str) -> str: ...
|
||||
def __mul__(self, n: int) -> str: ...
|
||||
def __rmul__(self, n: int) -> str: ...
|
||||
def __mod__(self, *args: Any) -> str: ...
|
||||
def __mod__(self, value: Any) -> str: ...
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: str) -> bool: ...
|
||||
@@ -388,6 +388,8 @@ class bytes(ByteString):
|
||||
def __add__(self, s: bytes) -> bytes: ...
|
||||
def __mul__(self, n: int) -> bytes: ...
|
||||
def __rmul__(self, n: int) -> bytes: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def __mod__(self, value: Any) -> bytes: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
@@ -485,6 +487,8 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def __mul__(self, n: int) -> bytearray: ...
|
||||
def __rmul__(self, n: int) -> bytearray: ...
|
||||
def __imul__(self, n: int) -> bytearray: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def __mod__(self, value: Any) -> bytes: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user