New submission from Andrea Corbellini <corbellini.and...@gmail.com>:

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.

----------
components: Interpreter Core
files: test.py
messages: 111935
nosy: candrea
priority: normal
severity: normal
status: open
title: Declaring a class creates circular references
type: resource usage
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file18251/test.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9417>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to