A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-April/111127.html below:

[Python-Dev] What if replacing items in a dictionary returns the new dictionary?

[Python-Dev] What if replacing items in a dictionary returns the new dictionary? [Python-Dev] What if replacing items in a dictionary returns the new dictionary?R. David Murray rdmurray at bitdance.com
Fri Apr 29 16:43:16 CEST 2011
On Fri, 29 Apr 2011 10:27:46 -0400, Roy Hyunjin Han <starsareblueandfaraway at gmail.com> wrote:
> It would be convenient if replacing items in a dictionary returns the
> new dictionary, in a manner analogous to str.replace().  What do you
> think?

This belongs on python-ideas, but the short answer is no.  The
general language design principle (as I understand it) is that
mutable object do not return themselves upon mutation, while
immutable objects do return the new object.

--
R. David Murray           http://www.bitdance.com
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4