On Wed, Feb 24, 2010 at 11:03 PM, sjdevn...@yahoo.com <sjdevn...@yahoo.com> wrote: > On Feb 24, 8:05 pm, Lawrence D'Oliveiro <l...@geek- > central.gen.new_zealand> wrote: >> In message <op.u8nfpex8y5e...@laptopwanja>, Wanja Gayk wrote: >> >> > Reference counting is about the worst technique for garbage collection. >> >> It avoids the need for garbage collection. > > That's like saying that driving a VW Beetle avoids the need for an > automobile. Reference counting is a form of garbage collection (like > mark-sweep, copy-collect, and others), not a way of avoiding it. > > You're right that ref counting in many implementations is more > deterministic than other common forms of garbage collection; IMO, > Python would be well-served by making the ref-counting semantics it > currently has a guaranteed part of the language spec--or at least > guaranteeing that when a function returns, any otherwise unreferenced > locals are immediately collected. > > I could be convinced otherwise, but I _think_ that that change would > offer an alternative to all of the interesting cases of where the > "with" statement is "useful".
You're forgetting global context objects, such as those for Decimal: http://docs.python.org/library/decimal.html#decimal.localcontext Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list