
May 31, 2004
7:49 a.m.
Raymond Hettinger wrote:
For strings at least, perhaps it is time to bite the bullet and include weak reference support directly. Weak reference support ups the per string memory overhead from five words (ob_type, ob_refcnt, ob_size, ob_shash, ob_sstate) to six. The whole concept of weak dictionaries is much more useful when strings can be used as keys and/or values.
Can you elaborate that? What specific, real-life application do you have in mind that requires strings to be weakly-referencable? Because strings are immutable, you often get unexpected references to them, so people have learned not to care about the life cycle of string objects. Regards, Martin