From: Daniele Varrazzo Date: Sun, 1 May 2022 20:44:37 +0000 (+0200) Subject: refactor: replace an assert with a type: ignore X-Git-Tag: 3.1~125^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb11a0b1834aba4796e21c0e6d3f9c7f0f2375c8;p=thirdparty%2Fpsycopg.git refactor: replace an assert with a type: ignore It's not like we give away opcodes for free here. --- diff --git a/psycopg/psycopg/cursor.py b/psycopg/psycopg/cursor.py index 0e549e084..0a534d563 100644 --- a/psycopg/psycopg/cursor.py +++ b/psycopg/psycopg/cursor.py @@ -743,8 +743,8 @@ class Cursor(BaseCursor["Connection[Any]", Row]): self._conn.wait(self._stream_send_gen(query, params, binary=binary)) first = True while self._conn.wait(self._stream_fetchone_gen(first)): - rec = self._tx.load_row(0, self._make_row) - assert rec is not None + # We know that, if we got a result, it has a single row. + rec: Row = self._tx.load_row(0, self._make_row) # type: ignore yield rec first = False