pgsql: PL/Python: Fix slicing support for result objects for Python 3 - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: PL/Python: Fix slicing support for result objects for Python 3
Date
Msg-id E1SSXMu-0004j6-IT@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
PL/Python: Fix slicing support for result objects for Python 3

The old way of implementing slicing support by implementing
PySequenceMethods.sq_slice no longer works in Python 3.  You now have
to implement PyMappingMethods.mp_subscript.  Do this by simply
proxying the call to the wrapped list of result dictionaries.
Consolidate some of the subscripting regression tests.

Jan Urbański

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a97207b6908f1d4a7d19b37b818367bb0171039f

Modified Files
--------------
src/pl/plpython/expected/plpython_spi.out |   75 +++++++++++++++++++++--------
src/pl/plpython/plpy_resultobject.c       |   26 ++++++++++-
src/pl/plpython/sql/plpython_spi.sql      |   51 ++++++++++++++------
3 files changed, 116 insertions(+), 36 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix Windows implementation of PGSemaphoreLock.
Next
From: Peter Eisentraut
Date:
Subject: pgsql: PL/Python: Update incorrect comment