Skip to content

refactor: add missing type hints to mysqlclient.connection #8393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions stubs/mysqlclient/MySQLdb/connections.pyi
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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: ...
Expand Down