[issue9417] Declaring a class creates circular references

Terry J. Reedy report at bugs.python.org
Fri Aug 6 21:38:15 CEST 2010


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Andrea: for the purpose of this tracker, a 'bug' is a discrepancy between doc and behavior. The fact that (new-style) classes have circular references was known when they were introduced in 2.2. That fact is not a bug in the above sense. It is a design tradeoff that works OK for the typical case of classes remaining until the end of a program run. Changing the tradeoff embodied in type() is not likely to be accepted.

That said, an alternate no_cr (no circular reference) metaclass (perhaps a type subclass) that contructed cr-free classes, even at the cost of slower lookup, might be a good addition to the stdlib. Ray's ideas seems to me at least plausible. My first thought on location is in functools.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9417>
_______________________________________


More information about the Python-bugs-list mailing list