PEP 510
* complete PyFunction_Specialize() description * add link to the implementation
This commit is contained in:
parent
3981ab06d2
commit
90c260b907
18
pep-0510.txt
18
pep-0510.txt
|
@ -342,6 +342,16 @@ with guards::
|
|||
int PyFunction_Specialize(PyObject *func,
|
||||
PyObject *code, PyObject *guards)
|
||||
|
||||
If *code* is a Python function, the code object of the *code* function
|
||||
is used as the specialized code. The specialized Python function must
|
||||
have the same parameter defaults, the same keyword parameter defaults,
|
||||
and must not have specialized code.
|
||||
|
||||
If *code* is a Python function or a code object, a new code object is
|
||||
created and the code name and first number number of the code object of
|
||||
*func* are copied. The specialized code must have the same cell
|
||||
variables and the same free variables.
|
||||
|
||||
Result:
|
||||
|
||||
* Return ``0`` on success
|
||||
|
@ -379,6 +389,14 @@ According to this microbenchmark, the changes has no overhead on calling
|
|||
a Python function without specialization.
|
||||
|
||||
|
||||
Implementation
|
||||
==============
|
||||
|
||||
The `issue #26098: PEP 510: Specialize functions with guards
|
||||
<http://bugs.python.org/issue26098>`_ contains a patch which implements
|
||||
this PEP.
|
||||
|
||||
|
||||
Other implementations of Python
|
||||
===============================
|
||||
|
||||
|
|
Loading…
Reference in New Issue