PEP 637: Addnew slots to the C interface (#1750)
This commit is contained in:
parent
a2269ff5b8
commit
23b9fffb1f
11
pep-0637.rst
11
pep-0637.rst
|
@ -606,7 +606,7 @@ need to be implemented to support the extended call. We propose
|
|||
- ``PyObject_SetItemWithKeywords(PyObject *o, PyObject *key, PyObject *value, PyObject *kwargs)``
|
||||
- ``PyObject_GetItemWithKeywords(PyObject *o, PyObject *key, PyObject *kwargs)``
|
||||
|
||||
Additionally, new opcodes will be needed for the enhanced call. Currently, the
|
||||
New opcodes will be needed for the enhanced call. Currently, the
|
||||
implementation uses ``BINARY_SUBSCR``, ``STORE_SUBSCR`` and ``DELETE_SUBSCR``
|
||||
to invoke the old functions. We propose ``BINARY_SUBSCR_KW``,
|
||||
``STORE_SUBSCR_KW`` and ``DELETE_SUBSCR_KW`` for the new operations. The
|
||||
|
@ -614,6 +614,15 @@ compiler will have to generate these new opcodes. The
|
|||
old C implementations will call the extended methods passing ``NULL``
|
||||
as kwargs.
|
||||
|
||||
Finally, the following new slots must be added to the ``PyMappingMethods`` struct:
|
||||
|
||||
- ``mp_subscript_kw``
|
||||
- ``mp_ass_subscript_kw``
|
||||
|
||||
These slots will have the appropriate signature to handle the dictionary object
|
||||
containing the keywords.
|
||||
|
||||
|
||||
Reference Implementation
|
||||
========================
|
||||
|
||||
|
|
Loading…
Reference in New Issue