Fred L. Drake, Jr. [fdrake@acm.org] wrote: > > Guido van Rossum writes: > > Yes, definitely. Weak dicts are sometimes needed for situations where > > a regular dict would keep objects alive forever. E.g. we were made > > aware of a "leak" in JPython that could only be fixed with weak dicts: > > the Swing wrapper code has a global dict mapping widgets to callback > > That's a perfect example. I've started working on some text > describing the motivation; hopefully I'll have that fleshed out and > checked in later this week. Another example is some of the things in Zope use back-references for ease of traversability (or worse keep weird counts hanging around). Alot of these are negated by ZODB's ability to break cycles, but... a lot of data structures would be hugely better from an architecture perspective if we had a native weak reference. Chris -- | Christopher Petrilli | petrilli@amber.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4