pgsql: PL/Python: Fix slicing support for result objects for Python 3

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: PL/Python: Fix slicing support for result objects for Python 3
Date: 2012-05-10 17:41:36
Message-ID: E1SSXMu-0004j6-IT@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2012-05-10 17:48:00 pgsql: Add comma after "Previously" as suggested by Josh Kupershmidt
Previous Message Bruce Momjian 2012-05-10 17:38:17 pgsql: 9.2 release note updates from Peter Geoghegan