mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
bpo-37540: vectorcall: keyword names must be strings (GH-14682)
The fact that keyword names are strings is now part of the vectorcall and `METH_FASTCALL` protocols. The biggest concrete change is that `_PyStack_UnpackDict` now checks that and raises `TypeError` if not. CC @markshannon @vstinner https://bugs.python.org/issue37540
This commit is contained in:
parent
f3cb68f2e4
commit
0567786d26
10 changed files with 43 additions and 46 deletions
|
|
@ -400,8 +400,8 @@ Object Protocol
|
|||
:c:func:`PyVectorcall_NARGS(nargsf) <PyVectorcall_NARGS>`.
|
||||
|
||||
*kwnames* can be either NULL (no keyword arguments) or a tuple of keyword
|
||||
names. In the latter case, the values of the keyword arguments are stored
|
||||
in *args* after the positional arguments.
|
||||
names, which must be strings. In the latter case, the values of the keyword
|
||||
arguments are stored in *args* after the positional arguments.
|
||||
The number of keyword arguments does not influence *nargsf*.
|
||||
|
||||
*kwnames* must contain only objects of type ``str`` (not a subclass),
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@ also keyword arguments. So there are a total of 6 calling conventions:
|
|||
Keyword arguments are passed the same way as in the vectorcall protocol:
|
||||
there is an additional fourth :c:type:`PyObject\*` parameter
|
||||
which is a tuple representing the names of the keyword arguments
|
||||
(which are guaranteed to be strings)
|
||||
or possibly *NULL* if there are no keywords. The values of the keyword
|
||||
arguments are stored in the *args* array, after the positional arguments.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue