mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 12:51:27 +08:00
pymysql.Cursor is a context manager (#3379)
This commit is contained in:
6
third_party/2and3/pymysql/cursors.pyi
vendored
6
third_party/2and3/pymysql/cursors.pyi
vendored
@@ -1,7 +1,9 @@
|
||||
from typing import Union, Tuple, Any, Dict, Optional, Text, Iterator, List
|
||||
from typing import Any, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union
|
||||
|
||||
from .connections import Connection
|
||||
|
||||
Gen = Union[Tuple[Any, ...], Dict[str, Any]]
|
||||
_SelfT = TypeVar("_SelfT")
|
||||
|
||||
class Cursor:
|
||||
connection: Connection
|
||||
@@ -26,6 +28,8 @@ class Cursor:
|
||||
def fetchall(self) -> Optional[Tuple[Gen, ...]]: ...
|
||||
def scroll(self, value: int, mode: str = ...): ...
|
||||
def __iter__(self): ...
|
||||
def __enter__(self: _SelfT) -> _SelfT: ...
|
||||
def __exit__(self, *exc_info: Any) -> None: ...
|
||||
|
||||
class DictCursor(Cursor):
|
||||
def fetchone(self) -> Optional[Dict[str, Any]]: ...
|
||||
|
||||
Reference in New Issue
Block a user