Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

Charles Yeomans charles at declareSub.com
Wed Jun 17 07:49:52 EDT 2009


On Jun 17, 2009, at 2:13 AM, Paul Rubin wrote:

> Lawrence D'Oliveiro <ldo at geek-central.gen.new_zealand> writes:
>>> Reference counting is an implementation detail used by CPython but  
>>> not
>>> [implementations built on runtimes designed for corporate-herd- 
>>> oriented
>>> languages, like] IronPython or Jython.
>>
>> I rest my case.
>
> You're really being pretty ignorant.  I don't know of any serious Lisp
> system that uses reference counting, both for performance reasons and
> to make sure cyclic structures are reclaimed properly.  Lisp is
> certainly not a corporate herd language.
>
> Even CPython doesn't rely completely on reference counting (it has a
> fallback gc for cyclic garbage).  Python introduced the "with"
> statement to get away from the kludgy CPython programmer practice of
> opening files and relying on the file being closed when the last
> reference went out of scope.

I'm curious as you why you consider this practice to be kludgy; my  
experience with RAII is pretty good.

Charles Yeomans




More information about the Python-list mailing list