[pypy-commit] pypy py3k: "add" an 'optimize' parameter to builtins.compile().
amauryfa
noreply at buildbot.pypy.org
Tue Mar 13 23:46:02 CET 2012
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r53508:ebad5e3163e2
Date: 2012-03-13 23:44 +0100
http://bitbucket.org/pypy/pypy/changeset/ebad5e3163e2/
Log: "add" an 'optimize' parameter to builtins.compile(). It's not used
yet, just like -OO is not handled. The py3k test suite will catch
this, though.
diff --git a/pypy/module/__builtin__/compiling.py b/pypy/module/__builtin__/compiling.py
--- a/pypy/module/__builtin__/compiling.py
+++ b/pypy/module/__builtin__/compiling.py
@@ -9,8 +9,9 @@
from pypy.interpreter.argument import Arguments
from pypy.interpreter.nestedscope import Cell
- at unwrap_spec(filename=str, mode=str, flags=int, dont_inherit=int)
-def compile(space, w_source, filename, mode, flags=0, dont_inherit=0):
+ at unwrap_spec(filename=str, mode=str, flags=int, dont_inherit=int, optimize=int)
+def compile(space, w_source, filename, mode, flags=0, dont_inherit=0,
+ optimize=0):
"""Compile the source string (a Python module, statement or expression)
into a code object that can be executed by the exec statement or eval().
The filename will be used for run-time error messages.
@@ -51,6 +52,7 @@
raise OperationError(space.w_ValueError,
space.wrap("compile() arg 3 must be 'exec' "
"or 'eval' or 'single'"))
+ # XXX optimize is not used
if ast_node is None:
if flags & consts.PyCF_ONLY_AST:
More information about the pypy-commit
mailing list