Issue 748126: Nails down the semantics of dict setitem (original) (raw)

Created on 2003-06-03 11:57 by david_abrahams, last changed 2022-04-10 16:08 by admin. This issue is now closed.

Messages (5)
msg43883 - (view) Author: David Abrahams (david_abrahams) Date: 2003-06-03 11:57
You could consider accomplishing the same thing in the footnotes area, but I didn't see any reason to make the reader jump around for this info.
msg43884 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2003-07-04 01:06
Logged In: YES user_id=3066 This report is very vague. What part of the documentation are you referring to, and how do you think it should be changed.
msg43885 - (view) Author: David Abrahams (david_abrahams) Date: 2003-07-04 02:42
Logged In: YES user_id=52572 I think I originally tried to attach a patch which SF dropped due to one of its usual bugs. I think the question was whether d[k] = y would unconditionally set the identity of the key object in d to k, or whether any previous equal key in that "slot" would be preserved. It's the latter, and the current docs don't say which one it is.
msg43886 - (view) Author: Michael Chermside (mcherm) (Python triager) Date: 2004-08-07 15:00
Logged In: YES user_id=99874 I asked about this on python-dev. Turns out that the behavior is the same in CPython and Jython (at least), but that it is officially undefined in the language (ie, if someone finds a more efficient way to implement a dict which happens to alter what happens when assigning to existing keys, then it might change). Therefore, I think it should NOT be documented. It's rare that people would create objects that compare equal and yet care which one is used, and anyone doing so should know what they're doing well enough to test it out.
msg43887 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-08-07 16:43
Logged In: YES user_id=6656 I agree. Closing.
History
Date User Action Args
2022-04-10 16:08:59 admin set github: 38581
2003-06-03 11:57:24 david_abrahams create