Thread

Commits

  1. Simplify some SPI tests of PL/Python

  2. doc: Fix example with __next__() in PL/Python function

  3. plpython: Adjust docs after removal of Python 2 support.

  1. Misprints in code

    The Post Office <noreply@postgresql.org> — 2024-11-20T08:13:51Z

    The following documentation comment has been logged on the website:
    
    Page: https://www.postgresql.org/docs/14/plpython-data.html
    Description:
    
    https://www.postgresql.org/docs/16/plpython-data.html#PLPYTHON-DATA-SET-RETURNING-FUNCS
    The code contains a misprint in the following section:    Iterator (any
    object providing __iter__ and next methods)
    
     def next (self):  must be:  def __next__ (self): 
    
    Also, the header - Iterator (any object providing __iter__ and next methods)
     should be  Iterator (any object providing __iter__ and __next__ methods)
    
  2. Re: Misprints in code

    Erik Wienhold <ewie@ewie.name> — 2024-11-21T15:31:07Z

    On 2024-11-20 09:13 +0100, PG Doc comments form wrote:
    > https://www.postgresql.org/docs/16/plpython-data.html#PLPYTHON-DATA-SET-RETURNING-FUNCS
    > The code contains a misprint in the following section:    Iterator (any
    > object providing __iter__ and next methods)
    > 
    >  def next (self):  must be:  def __next__ (self): 
    > 
    > Also, the header - Iterator (any object providing __iter__ and next methods)
    >  should be  Iterator (any object providing __iter__ and __next__ methods)
    
    Good catch!  That's a leftover from Python 2 and missed in commit
    4228cabb72b after Python 2 was dropped in 15.0.  Patch attached.
    
    While looking at, we can also simplify a couple of plpython3u test
    functions that still try res.next() before res.__next__().  Attached as
    a separate patch.
    
    -- 
    Erik
    
  3. Re: Misprints in code

    Michael Paquier <michael@paquier.xyz> — 2024-11-25T00:06:21Z

    On Thu, Nov 21, 2024 at 04:31:07PM +0100, Erik Wienhold wrote:
    > Good catch!  That's a leftover from Python 2 and missed in commit
    > 4228cabb72b after Python 2 was dropped in 15.0.  Patch attached.
    > 
    > While looking at, we can also simplify a couple of plpython3u test
    > functions that still try res.next() before res.__next__().  Attached as
    > a separate patch.
    
    Sounds about right to me, the example greet() fails with plpython3.
    For reference, this has been implemented in upstream here:
    https://peps.python.org/pep-3114/
    
    The existing tests of plpython mentioned this link, and I've bumped
    over it again while looking for references on the matter.
    
    Will fix.  Thanks for the report!
    --
    Michael