Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

Yes, there is an overhead of using the trashcan mechanism. This is why it is 
only used in data collections, because it is expected that your data can 
contain arbitrary long chains of links. There is many ways to create arbitrary 
long chains with other objects, but it does not happen in common code. For 
methods the cost would be especially high, because method objects are usually 
short-lived and the performance of creating/destroying is critical.

AFAIK the same issue (maybe not with __sizeof__, but with other method of the 
basic object class, like __reduce__) was already reported earlier. I propose to 
close  this issue as "won't fix".

----------
nosy: +serhiy.storchaka

_______________________________________
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