[Python-Dev] [PEP 576/580] Comparing PEP 576 and 580 (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Tue Jul 31 06:27:29 EDT 2018


On Tue, 31 Jul 2018 19:10:48 +0900 INADA Naoki <songofacandy at gmail.com> wrote:

I said "So PEP 576/580 are needed only when implementing callable object". I showed example "functools.partial or functools.lrucache". Using FASTCALL for callable object, instead of tpcall is one of important goal of PEP 576 and 580. So, cleary, ordinal extension author should be able to understand and implement PEP 576 and 580.

No, Jeroen is right here. Ordinary extension authors do not need to understand and implement PEP 576 and 580.

First, it's rare for extension types to be callable. Second, even if an extension type is callable, implementing PEP 576 or 580 is only useful if tp_call overhead is really important.

In any case, just using tp_call will be as good as it was before. There is no regression, hence it is incorrect to say that we place an additional burden on the shoulders of extension authors. Yes, they can learn an additional PEP to increase tp_call performance; but they don't have to.

Regards

Antoine.



More information about the Python-Dev mailing list