WeakValueDictionary
Bryan
belred1 at yahoo.com
Sat Oct 2 23:49:09 EDT 2004
More information about the Python-list mailing list
Sat Oct 2 23:49:09 EDT 2004
- Previous message (by thread): WeakValueDictionary
- Next message (by thread): WeakValueDictionary
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
there must be something i don't understand about WeakKeyDictionary and WeakValueDictionary. i had expected the last line to be empty because i thought i deleted the last strong reference to variable "a". what am i misunderstanding? >>> d = weakref.WeakValueDictionary() >>> a = A() >>> d[1] = a >>> d.items() [(1, <__main__.A instance at 0x0116BC60>)] >>> del a >>> d.items() [(1, <__main__.A instance at 0x0116BC60>)] >>> thanks, bryan
- Previous message (by thread): WeakValueDictionary
- Next message (by thread): WeakValueDictionary
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list