From 84e0984acde0c2dab632151730e8ef6f393c0612 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 24 Feb 2021 19:42:50 +0100 Subject: [PATCH] Fix documentation of Cursor.pgresult --- docs/cursor.rst | 6 +++++- psycopg3/psycopg3/cursor.py | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/cursor.rst b/docs/cursor.rst index 18ecbf25f..128bf4b28 100644 --- a/docs/cursor.rst +++ b/docs/cursor.rst @@ -132,7 +132,11 @@ The `!Cursor` class .. automethod:: fetchall .. automethod:: nextset .. automethod:: scroll - .. autoattribute:: pgresult + .. attribute:: pgresult + :type: Optional[psycopg3.pq.PGresult] + + The result returned by the last query and currently exposed by the + cursor, if available, else `!None`. .. rubric:: Information about the data diff --git a/psycopg3/psycopg3/cursor.py b/psycopg3/psycopg3/cursor.py index 9d2b75b29..e33640829 100644 --- a/psycopg3/psycopg3/cursor.py +++ b/psycopg3/psycopg3/cursor.py @@ -79,7 +79,6 @@ class BaseCursor(Generic[ConnectionType]): def _reset(self) -> None: self._results: List["PGresult"] = [] self.pgresult: Optional["PGresult"] = None - """The `~psycopg3.pq.PGresult` exposed by the cursor.""" self._pos = 0 self._iresult = 0 self._rowcount = -1 -- 2.47.2