STINNER Victor added the comment:

> I don't know. What's the point of optimizing `array.array.__len__(obj)`? 
> People usually call `len(obj)` for that...

Right, type.method(self) is less than common than self.method().

I looked at the stdlib. I found that the following method are called using 
wrapper descriptors:

* object.__repr__(self)
* object.__getattribute__(self, name)
* _asyncio.Future.__del__(self)
* int.__str__(obj)
* etc.

But it seems like such calls are rare compared to other kinds of function calls.

--

By the way, _PyMethodDescr_FastCallKeywords() is only called from 
call_function() in Python/ceval.c. It's not used in Objects/call.c. Maybe we 
should use it there as well? It seems like this is a question about tracing. 
But maybe we can copy/paste the code from call_function()?

----------

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

Reply via email to