Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tVRgw-008SrU-Ok for pgsql-docs@arkaria.postgresql.org; Wed, 08 Jan 2025 08:45:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tVRgv-00F6uq-EN for pgsql-docs@arkaria.postgresql.org; Wed, 08 Jan 2025 08:45:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tVRgv-00F6tr-6k for pgsql-docs@lists.postgresql.org; Wed, 08 Jan 2025 08:45:28 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tVRgp-000UuJ-0U for pgsql-docs@lists.postgresql.org; Wed, 08 Jan 2025 08:45:28 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id A9F0825401A6; Wed, 8 Jan 2025 03:45:21 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 08 Jan 2025 03:45:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1736325921; x=1736412321; bh=ceUXIhiQKlz91wK/ERnA+eUg+znC9QVcwEWeAuP04Bc=; b= UI4ReyZ/dkf1UUSwM+OC4pGnJew2qc86sVJAYqKfsWGlVVR7xF41LPy6G/GuK2Yd CrhELxKgIF8WfrCxYT8jc2b0bDX3xQGHrG8nxWSPDw6ruO1tg4bZNEFEHfoc77OC 62rZGMd2KUC9D5XNYXfew4bYT321Ea077OFnLQX1qPLwSA+OQ0/TsY0Ucw0dKzJf /J9wSHN1I1uR/ZHfkcVwNjMtvKMqeaiTdqeIQ3D95E+tnhUHFX6dm07Fj+gHGyDz nEL3YH+fzye1kZGuR8J7KsPwtHVgU5b+PwLZxT56HYevSMqEL4MXpndEUywVEY1N w5AVHVjP4Uma10kIYt7efg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736325921; x=1736412321; bh=c eUXIhiQKlz91wK/ERnA+eUg+znC9QVcwEWeAuP04Bc=; b=Bc/AQr+psJY5evAK+ apA61aDA+MhG5OfbutG9u0DChOdm1RYOuHE8vSFi/RivT8G+kRvU0sq2SxQmDiCW qvqKH6dzaBl5mZeQEMUlJGi9pDePw90Xv+zLkWZLrpjmQ0Blk6mvGKTNxld+NYtr UDYeV8+aiWE3cyf4Fg/Ce2Bdc/ofHgNQCxfRdL7DJIiMLFHmpyVgikzl3gGNLDsR Ij+Ia35h7Wns2pipgZfJqI/o98a5dT1YO/UP0GV+gvjP89lFQYBOs0kTagWgItpr edzEsugxpkETcVLc7KbA3isgwnxIhLuV25zEA89n1ALIxJxMPYcUZ9afLB0TZcot jJwjg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudegfedguddvudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgg gfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomheprfgvthgvrhcugfhishgvnhht rhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqeenucggtffrrghtth gvrhhnpefgffevhfdugedtudegleefleffleelgfdugeekjeejudduueeugefhgedvueeu teenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpdhphihthhhonhdrohhrgh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvght vghrsegvihhsvghnthhrrghuthdrohhrghdpnhgspghrtghpthhtohepvddpmhhouggvpe hsmhhtphhouhhtpdhrtghpthhtohepghhrihdrsghoghgurghnrddvtddvtdesghhmrghi lhdrtghomhdprhgtphhtthhopehpghhsqhhlqdguohgtsheslhhishhtshdrphhoshhtgh hrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Jan 2025 03:45:20 -0500 (EST) Message-ID: <3d320fce-1093-4132-9c55-07960bea2ea1@eisentraut.org> Date: Wed, 8 Jan 2025 09:45:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Some comments on PL/Python documentation To: gri.bogdan.2020@gmail.com, pgsql-docs@lists.postgresql.org References: <173543330569.680.6706329879058172623@wrigleys.postgresql.org> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <173543330569.680.6706329879058172623@wrigleys.postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.