William Pickard <lollol22...@gmail.com> added the comment:

Jumping in here to explain why '__class' doesn't crash when '__sizeof__' does:

When '__class__' is fetched, it returns a new reference to the object's type.

When '__sizeof__' is fetched on the otherhand, a new object is allocated on the 
heap ('types.MethodType') and is returned to the caller.

This object also has a '__sizeof__' that does the same (as it's implemented on 
'object'.

So yes, you are exhausting the C runtime stack by de-allocating over a THOUSAND 
objects.

You can see this happen by watching the memory usage of Python steadily climb.

----------
nosy: +WildCard65

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

Reply via email to