aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-11-25 09:15:45 +0900
committerMichael Paquier <michael@paquier.xyz>2024-11-25 09:15:45 +0900
commitef2f4727b3fabf1b4463def531a7d99264bc321b (patch)
tree5588e9c74db408a0a02ffb14e883f5df6465d58b
parent15ab513fed049984fc5f1400b3ceb3be4ae7c987 (diff)
downloadpostgresql-ef2f4727b3fabf1b4463def531a7d99264bc321b.tar.gz
postgresql-ef2f4727b3fabf1b4463def531a7d99264bc321b.zip
doc: Fix example with __next__() in PL/Python function
Per PEP 3114, iterator.next() has been renamed to iterator.__next__(), and one example in the documentation still used next(). This caused the example provided to fail the function creation since Python 2 is not supported anymore since 19252e8ec93. Author: Erik Wienhold Discussion: https://postgr.es/m/173209043143.2092749.13692266486972491694@wrigleys.postgresql.org Backpatch-through: 15
-rw-r--r--doc/src/sgml/plpython.sgml4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/src/sgml/plpython.sgml b/doc/src/sgml/plpython.sgml
index 513db640464..60d2a97b9f5 100644
--- a/doc/src/sgml/plpython.sgml
+++ b/doc/src/sgml/plpython.sgml
@@ -553,7 +553,7 @@ $$ LANGUAGE plpython3u;
<varlistentry>
<term>Iterator (any object providing <symbol>__iter__</symbol> and
- <symbol>next</symbol> methods)</term>
+ <symbol>__next__</symbol> methods)</term>
<listitem>
<para>
<programlisting>
@@ -569,7 +569,7 @@ AS $$
def __iter__ (self):
return self
- def next (self):
+ def __next__(self):
self.ndx += 1
if self.ndx == len(self.who):
raise StopIteration