[issue46925] Document dict behavior when setting equal but not identical key

2022-03-07 Thread Jarek Potiuk
Jarek Potiuk added the comment: Yeah. Sounds like adding docs is indeed needed :) -- ___ Python tracker ___ ___ Python-bugs-list

[issue46925] Document dict behavior when setting equal but not identical key

2022-03-06 Thread Inada Naoki
Inada Naoki added the comment: I don't know much about Java, but Java's WeakHashMap is same to Python's WeakKeyDictionary. https://docs.oracle.com/javase/9/docs/api/java/util/WeakHashMap.html """ This class is intended primarily for use with key objects whose equals methods test for object

[issue46925] Document dict behavior when setting equal but not identical key

2022-03-06 Thread Malthe Borch
Malthe Borch added the comment: Java's HashMap has also the (current) Python behavior. An existing same key is not replaced. -- ___ Python tracker ___

[issue46925] Document dict behavior when setting equal but not identical key

2022-03-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: The weakref docs in particular should point out the OP's example and highlight the workaround. -- ___ Python tracker ___

[issue46925] Document dict behavior when setting equal but not identical key

2022-03-05 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Agree, I couldn't find a place where this behavior is documented. The second paragraph in https://docs.python.org/3.10/library/stdtypes.html#mapping-types-dict comes close. Reopening as a documentation issue. -- assignee: -> docs@python