On 08.01.25 09:45, Peter Eisentraut wrote:
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.
I have added a test for returning Python sets from SETOF functions. It
makes sense to test this if the documentation claims it.