From: Michael Paquier Date: Mon, 25 Nov 2024 00:15:25 +0000 (+0900) Subject: doc: Fix example with __next__() in PL/Python function X-Git-Tag: REL_18_BETA1~1434 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=2ff7c913d92d8540e8b00c54746ce2f565521256;p=postgresql.git 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 --- diff --git a/doc/src/sgml/plpython.sgml b/doc/src/sgml/plpython.sgml index e5d51d6e9f5..bee817ea822 100644 --- a/doc/src/sgml/plpython.sgml +++ b/doc/src/sgml/plpython.sgml @@ -553,7 +553,7 @@ $$ LANGUAGE plpython3u; Iterator (any object providing __iter__ and - next methods) + __next__ methods) @@ -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