[issue26098] PEP 510: Specialize functions with guards

STINNER Victor report at bugs.python.org
Wed Jan 13 09:12:39 EST 2016


STINNER Victor added the comment:

Patch version 2 fixes some bugs and add more tests.

More notes about the patch:

* RuntimeError is raised if guard check() result is greater than 2
* RuntimeError is raised if guard init() result is greater than 1
* (hum, maybe 'res < 0' check must be replaced with 'res == -1', but I'm not sure that that it's worth it.)
* If PyFunction_Specialize() is called with a code object or a Python code, it creates a new code object and copies the code name and first line number in the new code object to ease debugging

TODO: keywords are currently not supported in PyGuard.__call__().

----------
Added file: http://bugs.python.org/file41602/specialize-2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26098>
_______________________________________


More information about the Python-bugs-list mailing list