psycopg2: correct return type (#7607)

Fixes the return type of `psycopg2.cursor.fetchone()` to match the psycopg2 code:

1d3a89a0bb/psycopg/cursor_type.c (L647-L651)
1d3a89a0bb/psycopg/cursor_type.c (L748-L786)

It also matches the [psycopg2 documentation](https://www.psycopg.org/docs/cursor.html?highlight=copy_from#cursor.fetchone) as well as the [DB-API](https://peps.python.org/pep-0249/#fetchone)
This commit is contained in:
Bao
2022-04-07 17:36:26 -05:00
committed by GitHub
parent 17b2f31b8c
commit 79c654ef43

View File

@@ -368,7 +368,7 @@ class cursor:
def executemany(self, query: str | bytes | Composable, vars_list: Iterable[_Vars]) -> None: ...
def fetchall(self) -> list[tuple[Any, ...]]: ...
def fetchmany(self, size=...) -> list[tuple[Any, ...]]: ...
def fetchone(self) -> tuple[Any, ...] | Any: ...
def fetchone(self) -> tuple[Any, ...] | None: ...
def mogrify(self, *args, **kwargs): ...
def nextset(self): ...
def scroll(self, value, mode=...): ...