[issue24123] Python 2.7 Tutorial Conflicting behavior with WeakValueDictionary.

2015-05-04 Thread R. David Murray
R. David Murray added the comment: Well, technically it is probably not a bug. IPython is doubtless holding on to a reference to 'a' because it was defined at the prompt. Perhaps it could use a weakvaluedict for that, though :) On the other hand they might consider it a feature that objects

[issue24123] Python 2.7 Tutorial Conflicting behavior with WeakValueDictionary.

2015-05-03 Thread Jesse Bacon
Jesse Bacon added the comment: After further testing it appears that the bug is in IPython not Python 2.7. The bug has been moved to the Python list at https://github.com/ipython/ipython/issues/8403#issuecomment-98565759 -- resolution: -> third party status: open -> closed __

[issue24123] Python 2.7 Tutorial Conflicting behavior with WeakValueDictionary.

2015-05-03 Thread Jesse Bacon
Jesse Bacon added the comment: Thank you for the second eyes. I just verified that it works using the standard python shell. It looks like the bug is in IPython. I’ll post it there. In [7]: class A: ...: def __init__(self, value): ...: self.value = value ...: def __r

[issue24123] Python 2.7 Tutorial Conflicting behavior with WeakValueDictionary.

2015-05-03 Thread R. David Murray
R. David Murray added the comment: If I run the example code you pasted using 2.7, I get a KeyError. So the example looks correct to me. -- nosy: +r.david.murray ___ Python tracker ___

[issue24123] Python 2.7 Tutorial Conflicting behavior with WeakValueDictionary.

2015-05-03 Thread Jesse Bacon
Jesse Bacon added the comment: https://docs.python.org/2/tutorial/stdlib2.html Section 11.6. Weak References The example code below from the python tutorial suggests that the value of 'a' is not persistent when cast into a WeakValueDictionary as entry 'primary' The value persisted in the dicti

[issue24123] Python 2.7 Tutorial Conflicting behavior with WeakValueDictionary.

2015-05-03 Thread Jesse Bacon
Jesse Bacon added the comment: https://docs.python.org/2/tutorial/stdlib2.html Section 11.6. Weak References The example code below from the python tutorial suggests that the value of 'a' is not persistent when cast into a WeakValueDictionary as entry 'primary' The value persisted in the dicti

[issue24123] Python 2.7 Tutorial Conflicting behavior with WeakValueDictionary.

2015-05-03 Thread Jesse Bacon
New submission from Jesse Bacon: https://docs.python.org/2/tutorial/stdlib2.html Section 11.6. Weak References The example code below from the python tutorial suggests that the value of a is no persistent when cast into a WeakValueDictionary as entry 'primary' The value persisted in the dictio