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/2010-October/104927.html below:

[Python-Dev] Issue 10194 - Adding a gc.remap() function

[Python-Dev] Issue 10194 - Adding a gc.remap() function [Python-Dev] Issue 10194 - Adding a gc.remap() functionHrvoje Niksic hrvoje.niksic at avl.com
Wed Oct 27 09:54:59 CEST 2010
On 10/26/2010 07:11 PM, Peter Ingebretson wrote:
> The main argument is that preserving immutable objects increases the
> complexity of remapping and does not actually solve many problems.
> The primary reason for objects to be immutable is so that their
> comparison operators and hash value can remain consistent.

There are other reasons as well (thread-safety), but I guess those don't 
really apply to python.  I guess one could defend the position that the 
tuple hasn't really "changed" if its elements merely get upgraded in 
this way, but it still feels wrong.

 > Changing,
 > for example, the contents of a tuple that a dictionary key references
 > has the same effect as changing the identity of the tuple -- both
 > modify the hash value of the key and thus invalidate the dictionary.
 > The full reload processs needs to rehash collections invalidated by
 > hash values changing, so we might as well modify the contents of
 > tuples.

Do you also rehash when tuples of upgraded objects are used as dict keys?
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