Make pyright happy

This commit is contained in:
Lonami Exo
2024-03-16 19:20:01 +01:00
parent 854096e9d3
commit 033b56f1d3
55 changed files with 435 additions and 309 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ def test_key_from_nonce() -> None:
server_nonce = int.from_bytes(bytes(range(16)))
new_nonce = int.from_bytes(bytes(range(32)))
(key, iv) = generate_key_data_from_nonce(server_nonce, new_nonce)
key, iv = generate_key_data_from_nonce(server_nonce, new_nonce)
assert (
key
== b'\x07X\xf1S;a]$\xf6\xe8\xa9Jo\xcb\xee\nU\xea\xab"\x17\xd7)\\\xa9!=\x1a-}\x16\xa6'
+1 -1
View File
@@ -7,7 +7,7 @@ from telethon._impl.mtproto import Abridged
class Output(bytearray):
__slots__ = ()
def __call__(self, data: bytes) -> None:
def __call__(self, data: bytes | bytearray | memoryview) -> None:
self += data
+2 -2
View File
@@ -7,7 +7,7 @@ from telethon._impl.mtproto import Full
class Output(bytearray):
__slots__ = ()
def __call__(self, data: bytes) -> None:
def __call__(self, data: bytes | bytearray | memoryview) -> None:
self += data
@@ -20,7 +20,7 @@ def setup_unpack(n: int) -> Tuple[bytes, Full, bytes, bytearray]:
transport, expected_output, input = setup_pack(n)
transport.pack(expected_output, input)
return expected_output, Full(), input, bytearray()
return expected_output, Full(), bytes(input), bytearray()
def test_pack_empty() -> None:
+1 -1
View File
@@ -7,7 +7,7 @@ from telethon._impl.mtproto import Intermediate
class Output(bytearray):
__slots__ = ()
def __call__(self, data: bytes) -> None:
def __call__(self, data: bytes | bytearray | memoryview) -> None:
self += data