mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
psycopg2: Annotate cursor execute* and dunder methods (#7460)
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
from typing import Any, Callable, TypeVar, overload
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable, Iterable, Mapping, Sequence
|
||||
from types import TracebackType
|
||||
from typing import Any, TypeVar, overload
|
||||
|
||||
import psycopg2
|
||||
import psycopg2.extensions
|
||||
|
||||
_Vars = Sequence[Any] | Mapping[str, Any] | None
|
||||
|
||||
BINARY: Any
|
||||
BINARYARRAY: Any
|
||||
BOOLEAN: Any
|
||||
@@ -358,8 +363,8 @@ class cursor:
|
||||
def copy_expert(self, sql, file, size=...): ...
|
||||
def copy_from(self, file, table, sep=..., null=..., size=..., columns=...): ...
|
||||
def copy_to(self, file, table, sep=..., null=..., columns=...): ...
|
||||
def execute(self, query, vars=...): ...
|
||||
def executemany(self, query, vars_list): ...
|
||||
def execute(self, query: str | bytes, vars: _Vars = ...) -> None: ...
|
||||
def executemany(self, query: str | bytes, vars_list: Iterable[_Vars]) -> None: ...
|
||||
def fetchall(self) -> list[tuple[Any, ...]]: ...
|
||||
def fetchmany(self, size=...) -> list[tuple[Any, ...]]: ...
|
||||
def fetchone(self) -> tuple[Any, ...] | Any: ...
|
||||
@@ -368,10 +373,12 @@ class cursor:
|
||||
def scroll(self, value, mode=...): ...
|
||||
def setinputsizes(self, sizes): ...
|
||||
def setoutputsize(self, size, column=...): ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, type, value, traceback): ...
|
||||
def __iter__(self): ...
|
||||
def __next__(self): ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
|
||||
) -> None: ...
|
||||
def __iter__(self: Self) -> Self: ...
|
||||
def __next__(self) -> tuple[Any, ...]: ...
|
||||
|
||||
class lobject:
|
||||
closed: Any
|
||||
|
||||
Reference in New Issue
Block a user