[Python-checkins] peps: PEP 510
victor.stinner
python-checkins at python.org
Wed Jan 13 11:14:49 EST 2016
https://hg.python.org/peps/rev/8aaa222b14b2
changeset: 6178:8aaa222b14b2
user: Victor Stinner <victor.stinner at gmail.com>
date: Wed Jan 13 15:16:46 2016 +0100
summary:
PEP 510
* complete PyFunction_Specialize() description
* add link to the implementation
files:
pep-0510.txt | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/pep-0510.txt b/pep-0510.txt
--- a/pep-0510.txt
+++ b/pep-0510.txt
@@ -342,6 +342,16 @@
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 @@
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
===============================
--
Repository URL: https://hg.python.org/peps
More information about the Python-checkins
mailing list