mysqlclient.connection: add missing type hints (#8393)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Kevin Kirsche
2022-07-26 09:26:35 -04:00
committed by GitHub
parent 33878a6ea4
commit d8b0c605ed

View File

@@ -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: ...