PEP 511: code transformer context
This commit is contained in:
parent
4da7e41f94
commit
2002aa056a
13
pep-0511.txt
13
pep-0511.txt
|
@ -277,6 +277,19 @@ Prototype::
|
|||
Parameters:
|
||||
|
||||
* *code*: code object
|
||||
* *context*: an object with an *optimize* attribute (``int``), the optimization
|
||||
level (0, 1 or 2). The value of the *optimize* attribute comes from the
|
||||
*optimize* parameter of the ``compile()`` function, it is equal to
|
||||
``sys.flags.optimize`` by default.
|
||||
|
||||
Each implementation of Python can add extra attributes to *context*. For
|
||||
example, on CPython, *context* will also have the following attribute:
|
||||
|
||||
* *interactive* (``bool``): true if in interactive mode
|
||||
|
||||
XXX add more flags?
|
||||
|
||||
XXX replace flags int with a sub-namespace, or with specific attributes?
|
||||
|
||||
The method must return a code object.
|
||||
|
||||
|
|
Loading…
Reference in New Issue