[issue9417] Declaring a class creates circular references

2020-04-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Kay, please ask your question on python-list or a similar forum. -- ___ Python tracker ___ ___

[issue9417] Declaring a class creates circular references

2020-04-25 Thread Kay Hayen
Kay Hayen added the comment: What I also meant to say, is that debug Python is not affected, and this had me deeply confused. Any ideas how that could happen? -- ___ Python tracker

[issue9417] Declaring a class creates circular references

2020-04-25 Thread Kay Hayen
Kay Hayen added the comment: Today I changed my reference count tests to not use debug Python and came across this issue. >From my testing, Python3.4 is the first affected version, Python3.3 was still >fine, so were 2.7 and 2.6. This leaks: def simpleFunction39(): class Parent(str):

[issue9417] Declaring a class creates circular references

2014-10-06 Thread Georg Brandl
Georg Brandl added the comment: I don't think this can go somewhere useful. -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9417 ___

[issue9417] Declaring a class creates circular references

2014-09-30 Thread Mark Lawrence
Mark Lawrence added the comment: Does anyone wish to take this forward, is it simply dead in the water or what? You might like to note that msg111963 refers to #812369 which was superseded by #18214 which was fixed in 3.4. -- nosy: +BreamoreBoy versions: +Python 3.5 -Python 3.2

[issue9417] Declaring a class creates circular references

2010-08-17 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9417 ___ ___ Python-bugs-list mailing

[issue9417] Declaring a class creates circular references

2010-08-07 Thread Ray.Allen
Ray.Allen ysj@gmail.com added the comment: krisvale: What about my suggestion of simply providing a convention on how to disable links manually, similar to how minidom.document does it with an unlink method? If these cases are documented, then there shouldn't be any extra bother to

[issue9417] Declaring a class creates circular references

2010-08-07 Thread Daniel Urban
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9417 ___ ___ Python-bugs-list

[issue9417] Declaring a class creates circular references

2010-08-07 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: I am opposed to a new 'unlink' builtin and '__unlink__' special method. There are more than enough builtin functions now, and this need is specific to those who both make lots temporary classes that they need garbage collected AND need to run

[issue9417] Declaring a class creates circular references

2010-08-06 Thread Terry J. Reedy
Terry J. Reedy tjre...@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

[issue9417] Declaring a class creates circular references

2010-08-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: What about my suggestion of simply providing a convention on how to disable links manually, similar to how minidom.document does it with an unlink method? If these cases are documented, then there shouldn't be any extra bother

[issue9417] Declaring a class creates circular references

2010-07-30 Thread Ray.Allen
Ray.Allen ysj@gmail.com added the comment: However here's a proposed solution: * for the __mro__: instead of using a tuple, use a new object that inherits from it. This new object should use weak reference for the first item and should return the real object (if available) only in

[issue9417] Declaring a class creates circular references

2010-07-30 Thread Andrea Colangelo
Andrea Colangelo andrea.colang...@gmail.com added the comment: I can confirm this bug should be addressed some way. On my high-traffic server, keeping GC enabled causes performance issues due to this bug, and disabling it causes an out-of-memory within hours. -- nosy: +warp10

[issue9417] Declaring a class creates circular references

2010-07-30 Thread Ray.Allen
Ray.Allen ysj@gmail.com added the comment: Is this due to your adopting of Django? Are there other guys who using Django suffer the same problem? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9417

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Andrea Corbellini
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

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Is there a reason why you want to disable the cyclic garbage collector? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9417

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- versions: -Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9417 ___

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Ray.Allen
Ray.Allen ysj@gmail.com added the comment: This should not be a problem, I think. We cannot avoid such a circular reference. I believe the main reason of the circular reference is in MyClass.__mro__, this is a list and contains a reference to MyClass. You can add __slots__ = [] to

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Andrea Corbellini
Andrea Corbellini corbellini.and...@gmail.com added the comment: Disabling the GC can increase performances (although not significantly). But this bug is the cause of other problems too: what if the metaclass contains a __del__() method? An another issue that I've found is that debugging is

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: I couldn't imagine why a metaclass would want to have a __del__ method... -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9417

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Andrea Corbellini
Andrea Corbellini corbellini.and...@gmail.com added the comment: Having a __del__ inside a metaclass is strange, I know... but probably there are situations where you need to do so. Why shouldn't a developer be able to add a __del__ to a metaclass without creating uncollectable objects? I

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Whether this is a bug is not clear. Sometimes it's just impossible not to create cycles, and classes may just be one instance of that. -- ___ Python tracker rep...@bugs.python.org

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +krisvale ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9417 ___ ___ Python-bugs-list mailing

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Andrea Corbellini
Andrea Corbellini corbellini.and...@gmail.com added the comment: This is an unwanted an unexpected behavior, so this is a bug by definition. If it's not easy to fix, it's a different matter. However here's a proposed solution: * for the __mro__: instead of using a tuple, use a new object that

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: This was discussed in issue1545463 which was deemed not to be worth fixing. The particular bug described in issue1545463 would also be fixed by the still open issue812369. So yes, there are cases where these cycles are

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: This is not so easy: the __mro__ tuple, as its name says, is used internally for method resolution, or finding attributes on the type's bases. __objclass__ is used whenever the descriptor is accessed. These operations are involved in every

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Interesting. Here is a case for disabling GC: We intentionally disable GC in Eve-online, because of the unpredictable lag spikes it produces. In a server application with gigabytes of python objects, GC can cause hickups of