]> granicus.if.org Git - postgresql/commit
PL/Python: Fix slicing support for result objects for Python 3
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 10 May 2012 17:38:17 +0000 (20:38 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 10 May 2012 17:40:30 +0000 (20:40 +0300)
commita97207b6908f1d4a7d19b37b818367bb0171039f
tree2449209dd19a0894107b9c616b0451b4a5f06a4c
parent1540d3bf4d405278533377ba81dbbf1c857eaec0
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
src/pl/plpython/expected/plpython_spi.out
src/pl/plpython/plpy_resultobject.c
src/pl/plpython/sql/plpython_spi.sql