Re: [Python-Dev] constant/enum type in stdlib

2010-11-23 Thread Ben . Cottrell
On Tue, 23 Nov 2010 15:15:29 +, Michael Foord wrote: > There are still two reasonable APIs (unless you have changed your mind > and think that sticking with plain integers is best), of which I prefer > the latter: > > SOME_CONST = Constant('SOME_CONST', 1) > OTHER_CONST = Constant('OTHER_CON

[Python-Dev] Reference leak in thread._local

2008-08-27 Thread Ben . Cottrell
I noticed that thread._local can leak references if objects are being stored inside the thread._local object whose destructors might release the GIL. The way this happens is that in Modules/threadmodule.c, in the _ldict() function, it does things like this: Py_CLEAR(self->dict);