pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: gri.bogdan.2020@gmail.com
To: pgsql-docs@lists.postgresql.org
Subject: Re: Some comments on PL/Python documentation
Date: Wed, 8 Jan 2025 09:45:19 +0100
Message-ID: <3d320fce-1093-4132-9c55-07960bea2ea1@eisentraut.org> (raw)
In-Reply-To: <173543330569.680.6706329879058172623@wrigleys.postgresql.org>
References: <173543330569.680.6706329879058172623@wrigleys.postgresql.org>

On 29.12.24 01:48, PG Doc comments form wrote:
> Page: https://www.postgresql.org/docs/17/plpython-data.html
> Description:
> 
> Hello,
> In my opinion, some phrases on this page are not quite correct.
> 
> 44.2.4. Composite Types
> You say: '...Object (any object providing method __getattr__)...'
> Actually, the object class provides the __getattribute__() method but not
> the __getattr__() method.
> See https://docs.python.org/3/reference/datamodel.html#object.__getattr__

Yes, this looks slightly inaccurate.  I'm not sure __getattribute__ is 
fully correct either, because types can also implement other ways of 
returning attributes, especially if they are implemented in C.  Is there 
a neutral and accurate way to describe this?

> 44.2.5. Set-Returning Functions
> 1. You say: '...Sequence type (tuple, list, set)...'
> Being an unordered collection, sets do not record element position or order
> of insertion. Accordingly, sets do not support indexing, slicing, or other
> sequence-like behavior.
> See
> https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset

I think this is correct as it is.  Python sets can be iterated over, so 
this works.  Note that earlier in the page under composite types it says 
"but not a set because it is not indexable", so this distinction was 
taken into consideration.

> 2. You say: '...Iterator (any object providing __iter__ and next
> methods)...'
> Actually, the iterator objects must support the __next__() method.
> See https://docs.python.org/3/glossary.html#term-iterator

Yes, this was recently fixed already and will appear in the next patch 
release.






view thread (3+ messages)  latest in thread

Message-ID: <3d320fce-1093-4132-9c55-07960bea2ea1@eisentraut.org>
Permalink:  ../3d320fce-1093-4132-9c55-07960bea2ea1@eisentraut.org/
Also on:    postgresql.org/message-id/3d320fce-1093-4132-9c55-07960bea2ea1@eisentraut.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: peter@eisentraut.org, gri.bogdan.2020@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: Some comments on PL/Python documentation
  In-Reply-To: <3d320fce-1093-4132-9c55-07960bea2ea1@eisentraut.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox