[Python-ideas] Python 3000 TIOBE -3%

Dirkjan Ochtman dirkjan at ochtman.nl
Fri Feb 10 10:16:28 CET 2012

On Thu, Feb 9, 2012 at 19:26, Guido van Rossum <guido at python.org> wrote:
> Are there still Python idioms/patterns/recipes around that depend on
> refcounting? (There also used to be some well-known anti-patterns that were
> only bad because of the refcounting, mostly around saving exceptions. But
> those should all have melted away -- CPython has had auxiliary GC for over a
> decade.)

There are some simple patterns that are great with refcounting and not
so great with garbage collection. We encountered some of these with
Mercurial. IIRC, the basic example is just


With refcounting, the file will be closed soon. With garbage
collection, it won't. Being able to rely on cleanup per frame/function
call is pretty useful.



More information about the Python-ideas mailing list