@@ -242,7 +242,7 @@ are always available. They are listed here in alphabetical order.
242242 Class methods can now wrap other :term: `descriptors <descriptor> ` such as
243243 :func: `property `.
244244
245- .. function :: compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1, noopt=None )
245+ .. function :: compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)
246246
247247 Compile the *source * into a code or AST object. Code objects can be executed
248248 by :func: `exec ` or :func: `eval `. *source * can either be a normal string, a
@@ -280,15 +280,16 @@ are always available. They are listed here in alphabetical order.
280280 object has ``CO_COROUTINE `` set in ``co_code ``, and can be interactively
281281 executed via ``await eval(code_object) ``.
282282
283+ If the *ast.PyCF_DISABLE_ALL_OPTIMIZATIONS * bit is set in *flags *, all compiler
284+ optimizations will be disabled and the value of *optimize * will be ignored. If
285+ this bit is not set, the value of ``sys.flags.noopt `` will be used.
286+
283287 The argument *optimize * specifies the optimization level of the compiler; the
284288 default value of ``-1 `` selects the optimization level of the interpreter as
285289 given by :option: `-O ` options. Explicit levels are ``0 `` (no optimization;
286290 ``__debug__ `` is true), ``1 `` (asserts are removed, ``__debug__ `` is false)
287291 or ``2 `` (docstrings are removed too).
288292
289- If *noopt * is false, disable compiler optimizations and ignore *optimize *
290- argument. If it is ``None ``, use ``sys.flags.noopt `` value.
291-
292293 This function raises :exc: `SyntaxError ` if the compiled source is invalid,
293294 and :exc: `ValueError ` if the source contains null bytes.
294295
0 commit comments