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

INADA Naoki songofacandy at gmail.com
Tue Jul 31 06:44:53 EDT 2018


On Tue, Jul 31, 2018 at 7:27 PM Antoine Pitrou <solipsis at pitrou.net> wrote:

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.

Ah, my wording "ordinary" was wrong.

But Jeroen was wrong too. He said "PEP 567 is also quite technical and not understandable by people who don't care about context variables."

People can skip PEP 567 easily when they don't care about contextvars.

On the other hand, *if we accept PEP 576 over PEP 580", C extension author will use it easily. So when comparing PEP 576 and 580, understandability for C extension author is not out of the scope.

Note that I didn't claim how important it is. I just compare design of PEP 576 and PEP 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 tpcall overhead is really important. In any case, just using tpcall 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 tpcall performance; but they don't have to.

I agree here. I have grepped tp_call usage and about to send mail explaining "Why FASTCALL for tp_call is not so important".

Regards Antoine.

-- INADA Naoki <songofacandy at gmail.com>



More information about the Python-Dev mailing list