[Python-Dev] Can we make METH_FASTCALL public, from Python 3.7? (ref: PEP 579

Victor Stinner vstinner at redhat.com
Wed Jun 20 12:09:00 EDT 2018


Hi,

I chose to make it private because I wasn't sure about the API. I was
right: Serhiy removed keyword arguments from METH_FASTCALL, you now
have to use METH_FASTCALL | METH_KEYWORDS to also pass keyword
arguments ;-) I don't recall if this change was done in 3.7 or also in
3.6. FASTCALL has been introduced in 3.6 if I recall correctly.

I didn't write much documentation about FASTCALL, only 2 articles. The
most interesting one:
https://vstinner.github.io/fastcall-microbenchmarks.html

METH_FASTCALL is already used by Cython, so I'm not sure that it's
fully private :-)

> _PyObject_FastCall* APIs are private in Python 3.7.

I'm not sure that it's worth it to make these functions public, they
are already used internally, when using PyObject_CallFunction() for
example. And it may be painful for PyPy (and others) to have to
explain all these new functions.

> If we can't at Python 3.7, I think we should do it at 3.8.

What's the rationale to make it public in 3.7? Can't it wait for 3.8?
The new PEPs target 3.8 anyway, no?

IMHO it's too late for 3.7.

Victor

2018-06-20 17:42 GMT+02:00 INADA Naoki <songofacandy at gmail.com>:
> Hi, All.
>
> First of all, thank you Jeroen for writing nice PEPs.
>
> When I read PEP 579, I think "6. METH_FASTCALL is private and undocumented"
> should be solved first.
>
> I don't have any idea about changing METH_FASTCALL more.
> If Victor and Serhiy think so, and PyPy maintainers like it too, I want to
> make it public
> as soon as possible.
>
> _PyObject_FastCall* APIs are private in Python 3.7.
> But METH_FASTCALL is not completely private (start without underscore,
> but not documented)
> Can we call it as public, stable by adding document, if Ned allows?
>
> It's used widely in Python internals already.  I suppose that making it
> public
> doesn't make Python 3.7 unstable much.
>
> If we can't at Python 3.7, I think we should do it at 3.8.
>
> Regards,
> --
> INADA Naoki  <songofacandy at gmail.com>


More information about the Python-Dev mailing list