diff --git a/stubs/mysqlclient/MySQLdb/connections.pyi b/stubs/mysqlclient/MySQLdb/connections.pyi index 6c95e8a40..c03fcc594 100644 --- a/stubs/mysqlclient/MySQLdb/connections.pyi +++ b/stubs/mysqlclient/MySQLdb/connections.pyi @@ -1,7 +1,8 @@ from _typeshed import Self +from types import TracebackType from typing import Any -from . import _mysql, cursors as cursors +from . import _mysql, cursors from ._exceptions import ( DatabaseError as DatabaseError, DataError as DataError, @@ -20,16 +21,18 @@ re_numeric_part: Any def numeric_part(s): ... class Connection(_mysql.connection): - default_cursor: Any - cursorclass: Any + default_cursor: type[cursors.Cursor] + cursorclass: type[cursors.BaseCursor] encoders: Any encoding: str messages: Any - def __init__(self, *args, **kwargs): ... + def __init__(self, *args, **kwargs) -> None: ... def __enter__(self: Self) -> Self: ... - def __exit__(self, exc_type, exc_value, traceback) -> None: ... - def autocommit(self, on) -> None: ... - def cursor(self, cursorclass: Any | None = ...): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... + def autocommit(self, on: bool) -> None: ... + def cursor(self, cursorclass: type[cursors.BaseCursor] | None = ...): ... def query(self, query) -> None: ... def literal(self, o): ... def begin(self) -> None: ...