Message111935
Creating a class (either using the 'class' statement or using type()) creates a circular reference.
I've attached a script that simply demonstrates this. The problem is caused by the fact that MyClass.__dict__['__dict__'].__objclass__ is MyClass.
Although most of the times classes are never deleted when the interpreted exits, some programs (like the popular Django framework) create temporary classes. And this is a pain because you can't disable the garbage collector. |
|
Date |
User |
Action |
Args |
2010-07-29 14:19:46 | andrea.corbellini | set | recipients:
+ andrea.corbellini |
2010-07-29 14:19:45 | andrea.corbellini | set | messageid: <1280413185.92.0.0897116981748.issue9417@psf.upfronthosting.co.za> |
2010-07-29 14:19:44 | andrea.corbellini | link | issue9417 messages |
2010-07-29 14:19:43 | andrea.corbellini | create | |
|