From bb7de08e6764642dfd49eb125db397c3ab6dc702 Mon Sep 17 00:00:00 2001 From: Pixeless_ Date: Thu, 5 Nov 2026 03:24:45 +0800 Subject: [PATCH] [PyMySQL] Replace Incomplete in MySQLResult, protocol and _auth --- stubs/PyMySQL/pymysql/_auth.pyi | 10 +++++++--- stubs/PyMySQL/pymysql/connections.pyi | 5 ++--- stubs/PyMySQL/pymysql/protocol.pyi | 3 +-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/stubs/PyMySQL/pymysql/_auth.pyi b/stubs/PyMySQL/pymysql/_auth.pyi index d8fe1ba35864..2c93c371cbf9 100644 --- a/stubs/PyMySQL/pymysql/_auth.pyi +++ b/stubs/PyMySQL/pymysql/_auth.pyi @@ -1,13 +1,17 @@ -from _typeshed import Incomplete, ReadableBuffer +from _hashlib import HASH +from _typeshed import ReadableBuffer +from functools import partial from typing import Final +from .protocol import MysqlPacket + DEBUG: Final[bool] SCRAMBLE_LENGTH: Final[int] -sha1_new: Incomplete +sha1_new: partial[HASH] def scramble_native_password(password: ReadableBuffer | None, message: ReadableBuffer | None) -> bytes: ... def ed25519_password(password: ReadableBuffer, scramble: ReadableBuffer) -> bytes: ... def sha2_rsa_encrypt(password: bytes, salt: bytes, public_key: bytes) -> bytes: ... def sha256_password_auth(conn, pkt): ... def scramble_caching_sha2(password: ReadableBuffer, nonce: ReadableBuffer) -> bytes: ... -def caching_sha2_password_auth(conn, pkt) -> Incomplete | None: ... +def caching_sha2_password_auth(conn, pkt) -> MysqlPacket | None: ... diff --git a/stubs/PyMySQL/pymysql/connections.pyi b/stubs/PyMySQL/pymysql/connections.pyi index 7d03d41f4b25..338a8893b35e 100644 --- a/stubs/PyMySQL/pymysql/connections.pyi +++ b/stubs/PyMySQL/pymysql/connections.pyi @@ -265,12 +265,11 @@ class MySQLResult: warning_count: int message: str | None field_count: int - description: Incomplete - rows: Incomplete + description: tuple[tuple[str, int, None, int, int, int, bool], ...] | None + rows: tuple[tuple[Any, ...], ...] | None has_next: bool | None unbuffered_active: bool def __init__(self, connection: Connection[Any]) -> None: ... def __del__(self) -> None: ... - first_packet: Incomplete def read(self) -> None: ... def init_unbuffered_query(self) -> None: ... diff --git a/stubs/PyMySQL/pymysql/protocol.pyi b/stubs/PyMySQL/pymysql/protocol.pyi index dd742364215a..718b32c33ed6 100644 --- a/stubs/PyMySQL/pymysql/protocol.pyi +++ b/stubs/PyMySQL/pymysql/protocol.pyi @@ -1,4 +1,3 @@ -from _typeshed import Incomplete from typing import Final DEBUG: Final[bool] @@ -25,7 +24,7 @@ class MysqlPacket: def read_uint32(self): ... def read_uint64(self): ... def read_string(self): ... - def read_length_encoded_integer(self) -> Incomplete | None: ... + def read_length_encoded_integer(self) -> int | None: ... def read_length_coded_string(self): ... def read_struct(self, fmt: str): ... def is_ok_packet(self) -> bool: ...