]> git.ipfire.org Git - thirdparty/psycopg.git/commit
fix: improve set_result() proposal: 1177/head
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 22 Nov 2025 17:06:08 +0000 (18:06 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 22 Nov 2025 17:09:14 +0000 (18:09 +0100)
commit96bf39556a8c3bf77aef0be47bb49171de647785
treea06f87ac9000da3fff8ef07a3c88b4e4ce32a7b5
parentf3c32209d2d8b5da51b5f414ab4b1b6a9ad8782a
fix: improve set_result() proposal:

- make it async on async cursors (consistently with `results()`,
  inconsistently with `nextset()`, but the latter being sync on async
  cursors was a design mistake);
- raise IndexError, consistently with sequences, better error message;
- fix test, which were simply broken and the OP didn't bother to fix
  them;
- documentation improved.
docs/api/cursors.rst
docs/news.rst
psycopg/psycopg/_cursor_base.py
psycopg/psycopg/cursor.py
psycopg/psycopg/cursor_async.py
tests/test_cursor_common.py
tests/test_cursor_common_async.py