[issue44214] PyArg_Parse* for vectorcall?

2021-05-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are alternative ideas of parsing API which should be considered:

1. Linearize keyword arguments using _PyArg_UnpackKeywords() and parse the 
linear array of arguments with a variant of _PyArg_ParseStack().

2. Parse arguments outside of the user function and pass already parsed values 
(as in Argument Clinic). Or just pre-process keyword arguments and pass a 
continuous array of arguments with possible NULLs for optional parameters. 
Specification for parsing arguments should be added to PyMethodDef.

I do not know what idea will work better, it needs experimentation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44214] PyArg_Parse* for vectorcall?

2021-05-25 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Annoyingly the keywords variant is the most interesting to expose :-) due to 
the complexity of correctly interpreting keyword arguments.

I agree that we should be careful in exposing the APIs using _PyArg_Parser, 
although it should be easer to expose it only in the non-stable ABI because 
extensions should be recompiled for new python releases anyway.

That said, I won't work on this issue myself (or at least not anytime soon). My 
current use case doesn't use keyword arguments, and open coding the calls to 
PyArg_ParseTuple is easy enough for now (even if that leads to more 
boilerplate).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44214] PyArg_Parse* for vectorcall?

2021-05-24 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +methane

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44214] PyArg_Parse* for vectorcall?

2021-05-23 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44214] PyArg_Parse* for vectorcall?

2021-05-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are no problems with exposing _PyArg_ParseStack(). Although I am arguing 
that it would be better to rename it to _PyArg_ParseArray.

But _PyArg_ParseStackAndKeywords() is more complicated. It uses a private 
structure _PyArg_Parser allocated on the stack. It was not important while it 
was private, but the layout of _PyArg_Parser cannot be changed after making it 
a public structure unless we add support for expanding supporting of future 
versions of the structure from initial. This requires attentive development of 
future design. Fortunately most of the functions and methods in CPython have 
already been converted to Argument Clinic, so it's easier now to experiment 
with designs by making Argument Clinic generating different code. Although this 
is still an amount of work.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44214] PyArg_Parse* for vectorcall?

2021-05-23 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
type:  -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44214] PyArg_Parse* for vectorcall?

2021-05-23 Thread Ronald Oussoren


New submission from Ronald Oussoren :

I'm currently converting some extensions of my own to vectorcall and an 
annoying change between the old call protocol and vectorcall is that the latter 
has no public equivalent to the PyArg_Parse family of functions.

There is "_PyArg_ParseStack*" in the CPython implementation, but those 
functions are not part of the public API.

Please consider making "_PyArg_ParseStack" public.

--
components: C API
messages: 394194
nosy: ronaldoussoren
priority: normal
severity: normal
status: open
title: PyArg_Parse* for vectorcall?
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com