separation between mutating and non-mutating methods, and to help catch mistakes resulting from mixing them up.7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=etYqO01OszhEpqgjLeKQTMC9b3wT0sc%2FcN8oJo9eEhk%3D&reserved=0
--
Greg
-- https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.python.org%2Fmailman%2Flistinfo%2Fpython-list&data=05%7C01%7Cdvl%40psu.edu%7C744c83fc485a4b1c79db08daec19a436%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C638081892123929669%
Of course there are other paths in that direction, such as setting an attribute of the list/object first that affects how things getlater methods are invoked.
returned but that seems more cumbersome and makes all kinds of errors
more likely. Still, that is a path often used by some Python modules
where objects are created and then tweaked to behave in various ways when
But is any of it needed? The current system generally works fine and
we have seen many ways to get other results without tampering with the current implementation.
This may be yet another example of people who come to python with pre-existing bias, such as insisting it work like another language
they have used, or wanting the computer to do what they MEANT rather
than what they explicitly or implicitly programmed!
-----Original Message-----
From: Python-list
<python-list-bounces+avi.e.gross=gmail.com@python.org> On Behalf Of
Greg Ewing
Sent: Saturday, December 31, 2022 7:21 PM
To: python-list@python.org
Subject: Re: NoneType List
On 1/01/23 11:36 am, avi.e.gross@gmail.com wrote:
And, of course, we had the philosophical question of why the feature
was designed to not return anything ... rather than return the
changed object.
My understanding is that Guido designed it that way to keep a clear separation between mutating and non-mutating methods, and to help
catch mistakes resulting from mixing them up.
--
Greg
--
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail .python.org%2Fmailman%2Flistinfo%2Fpython-list&data=05%7C01%7Cdvl%40ps u.edu%7C744c83fc485a4b1c79db08daec19a436%7C7cf48d453ddb4389a9c1c115526 eb52e%7C0%7C0%7C638081892123929669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4 wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7 C&sdata=etYqO01OszhEpqgjLeKQTMC9b3wT0sc%2FcN8oJo9eEhk%3D&reserved=0
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 63:43:13 |
Calls: | 6,712 |
Files: | 12,244 |
Messages: | 5,355,976 |