Skip to content

Commit bb7de08

Browse files
committed
[PyMySQL] Replace Incomplete in MySQLResult, protocol and _auth
1 parent dac770d commit bb7de08

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

‎stubs/PyMySQL/pymysql/_auth.pyi‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
from _typeshed import Incomplete, ReadableBuffer
1+
from _hashlib import HASH
2+
from _typeshed import ReadableBuffer
3+
from functools import partial
24
from typing import Final
35

6+
from .protocol import MysqlPacket
7+
48
DEBUG: Final[bool]
59
SCRAMBLE_LENGTH: Final[int]
6-
sha1_new: Incomplete
10+
sha1_new: partial[HASH]
711

812
def scramble_native_password(password: ReadableBuffer | None, message: ReadableBuffer | None) -> bytes: ...
913
def ed25519_password(password: ReadableBuffer, scramble: ReadableBuffer) -> bytes: ...
1014
def sha2_rsa_encrypt(password: bytes, salt: bytes, public_key: bytes) -> bytes: ...
1115
def sha256_password_auth(conn, pkt): ...
1216
def scramble_caching_sha2(password: ReadableBuffer, nonce: ReadableBuffer) -> bytes: ...
13-
def caching_sha2_password_auth(conn, pkt) -> Incomplete | None: ...
17+
def caching_sha2_password_auth(conn, pkt) -> MysqlPacket | None: ...

‎stubs/PyMySQL/pymysql/connections.pyi‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,11 @@ class MySQLResult:
265265
warning_count: int
266266
message: str | None
267267
field_count: int
268-
description: Incomplete
269-
rows: Incomplete
268+
description: tuple[tuple[str, int, None, int, int, int, bool], ...] | None
269+
rows: tuple[tuple[Any, ...], ...] | None
270270
has_next: bool | None
271271
unbuffered_active: bool
272272
def __init__(self, connection: Connection[Any]) -> None: ...
273273
def __del__(self) -> None: ...
274-
first_packet: Incomplete
275274
def read(self) -> None: ...
276275
def init_unbuffered_query(self) -> None: ...

‎stubs/PyMySQL/pymysql/protocol.pyi‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from _typeshed import Incomplete
21
from typing import Final
32

43
DEBUG: Final[bool]
@@ -25,7 +24,7 @@ class MysqlPacket:
2524
def read_uint32(self): ...
2625
def read_uint64(self): ...
2726
def read_string(self): ...
28-
def read_length_encoded_integer(self) -> Incomplete | None: ...
27+
def read_length_encoded_integer(self) -> int | None: ...
2928
def read_length_coded_string(self): ...
3029
def read_struct(self, fmt: str): ...
3130
def is_ok_packet(self) -> bool: ...

0 commit comments

Comments
 (0)