From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gZR/IO2jC2mq4CMAWB0awg (envelope-from ) for ; Wed, 05 Nov 2025 14:22:21 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=comcast.net header.i=@comcast.net header.a=rsa-sha256 header.s=20190202a header.b=lC4vf/+r; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7FD741E04C; Wed, 05 Nov 2025 14:22:21 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 10DF91E04C for ; Wed, 05 Nov 2025 14:22:21 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 43712385C424 for ; Wed, 5 Nov 2025 19:22:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43712385C424 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=comcast.net header.i=@comcast.net header.a=rsa-sha256 header.s=20190202a header.b=lC4vf/+r Received: from resqmta-c2p-570217.sys.comcast.net (resqmta-c2p-570217.sys.comcast.net [IPv6:2001:558:fd00:56::7]) by sourceware.org (Postfix) with ESMTPS id BB5EA385B53D for ; Wed, 5 Nov 2025 19:21:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB5EA385B53D Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=comcast.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=comcast.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BB5EA385B53D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:558:fd00:56::7 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762370509; cv=none; b=oTry98+qqSzCoWvhqmW2Pu7apucBiQfA/oeqEq0k9mewE+xbB9AsnNVomg8statTG7jG4ijP0PgDHfl4YRCj7DHwAYFpowj56AEMl9dhGMl+BaeM4wK7sYPmH/Jw5dJLljBxBrGQE3Jy+DAUy6cawK6oIGRRYs2hRF0Qf6cBCcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762370509; c=relaxed/simple; bh=5wDGnEHCX0hH2TrGkV2hNuyzmKWS2oS0GynSlsIwVjo=; h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To; b=Ix7e5ujuVxXAXyiJ/u+zl6hNrHaEu9ER5Qi33nwo78/cuqFfcJi3gVDeD/wM3d8bTWo2ypJaAoXntzX/ec4aUoWm7ZgBhpjjpY250cyL9ps1Ry+fjrksn3Wdv8pFTVRY4SsFGM6YBQVMhpTXsxZnMXUjqoiGas8aE4JwvWiqli8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB5EA385B53D Received: from resomta-c2p-555442.sys.comcast.net ([96.102.18.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 256/256 bits) (Client did not present a certificate) by resqmta-c2p-570217.sys.comcast.net with ESMTPS id GcSYvgWB8xt2TGj4mvOnb9; Wed, 05 Nov 2025 19:21:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1762370509; bh=PtxIkj+bkUmwQu7jyHrY4BIgUAigk0NBpWAlwQ4WrCM=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To:Xfinity-Spam-Result; b=lC4vf/+ryYGSdqldjQimgLPd/DRhZcn+mC4dXToAVfo4nJT+YHhuzJFS6IJqZJxy3 RzhdeLbB2mPqUl1+zSglBPqFQlr+iNhYF/DgFBdMKabSpPUL/m2Pa2deCotZXlEwRx MJl5vlgDqLVpb0+lHeB5CXmru9p+QXU7tPwhP4Zw3cE4w5aYjZMan3Ux5O1n0kr+/t ewpkn3DDjw8LtGt3AVLDyMt/MjTHWnhtzQ+jZrlGmoP6SsO1lJGvPImitvJEf7Ddts OSE5knq7WZqXbeF7eIMEoAvpsj06dnAqsStKYBQ1btqm/CZhY3g4Wwcl51V0bbg+9/ dBx9eVsxVIMbw== Received: from smtpclient.apple ([73.60.223.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 256/256 bits) (Client did not present a certificate) by resomta-c2p-555442.sys.comcast.net with ESMTPSA id Gj4lv0oV0B5zeGj4mvdrS2; Wed, 05 Nov 2025 19:21:48 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PATCH] Minor doc fix for Python Type.fields From: Paul Koning In-Reply-To: <87bjlg9u6t.fsf@tromey.com> Date: Wed, 5 Nov 2025 14:21:36 -0500 Cc: gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20251105181059.3444537-1-tromey@adacore.com> <7B3296F3-200D-42C9-83E9-FFF258812844@comcast.net> <87bjlg9u6t.fsf@tromey.com> To: Tom Tromey X-Mailer: Apple Mail (2.3826.700.81) X-CMAE-Envelope: MS4xfBVNZrC4HbjKgoP9PKxuEW5CqVvMH3TtBHZaIyZfX0wd/mZvIU/D36mj/tFHIGmcaG0ArFMH/6GBumzjWxE+jVeLpjwMf0uA8+l6+sPpXmZxL28HfgxJ 51DZ28hsuIfLtKLaVmWoZfE4mGVyPHHYvDAe8N41o68Q6F97PfpiN2KcxlgzRWbYLj7BKTgHk17MjzQLs/sdPeGgpPeP3MDA1ft62Ee+XldFu3wyU8mqTDzf X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org > On Nov 5, 2025, at 2:05=E2=80=AFPM, Tom Tromey = wrote: >=20 >>> * Documents that a new sequence is always returned I've = intentionally >>> not mentioned that it is currently a list, in case we want to change >>> to a tuple someday. >=20 > Paul> Why is it important to say that a new sequence is returned? It > Paul> seems to me that someday we may want to return the same sequence > Paul> if thisis called multiple times. >=20 > Yeah, I guess it isn't needed always. > Like if gdb ever returned a tuple, it could be memoized. > I wonder if Python has some idiomatic way to say "this is guaranteed = to > either return a tuple or a new list" >=20 > Or if we should just write 'new list' and commit gdb to not memoizing. >=20 > Tom My point is slightly different. No matter what sequence type is = returned, for a given Type object the value of the sequence returned = would be the same if you call that method twice, right? So if I do: a =3D sometype.fields() b =3D sometype.fields() then a =3D=3D b. The statement "new sequence" promises that "a is not = b", i.e., a and b are not the same object. But I see no reason why that = is a useful property, and whether a and b are lists or tuples, it would = be reasonable for "a is b" to hold. (Reasonable though not required.) paul