Kaydet (Commit) 47f27a34 authored tarafından Georg Brandl's avatar Georg Brandl

Forward-port of #992207 fix: document that the parser only accepts \\n newlines.…

Forward-port of #992207 fix: document that the parser only accepts \\n newlines. (And remove a leftover footnote.)
üst b3259a4a
...@@ -334,12 +334,12 @@ are always available. They are listed here in alphabetical order. ...@@ -334,12 +334,12 @@ are always available. They are listed here in alphabetical order.
This function supports dynamic execution of Python code. *object* must be This function supports dynamic execution of Python code. *object* must be
either a string or a code object. If it is a string, the string is parsed as either a string or a code object. If it is a string, the string is parsed as
a suite of Python statements which is then executed (unless a syntax error a suite of Python statements which is then executed (unless a syntax error
occurs). If it is a code object, it is simply executed. In all cases, the occurs). [#]_ If it is a code object, it is simply executed. In all cases,
code that's executed is expected to be valid as file input (see the section the code that's executed is expected to be valid as file input (see the
"File input" in the Reference Manual). Be aware that the :keyword:`return` section "File input" in the Reference Manual). Be aware that the
and :keyword:`yield` statements may not be used outside of function :keyword:`return` and :keyword:`yield` statements may not be used outside of
definitions even within the context of code passed to the :func:`exec` function definitions even within the context of code passed to the
function. The return value is ``None``. :func:`exec` function. The return value is ``None``.
In all cases, if the optional parts are omitted, the code is executed in the In all cases, if the optional parts are omitted, the code is executed in the
current scope. If only *globals* is provided, it must be a dictionary, which current scope. If only *globals* is provided, it must be a dictionary, which
...@@ -1275,13 +1275,10 @@ are always available. They are listed here in alphabetical order. ...@@ -1275,13 +1275,10 @@ are always available. They are listed here in alphabetical order.
.. rubric:: Footnotes .. rubric:: Footnotes
.. [#] Specifying a buffer size currently has no effect on systems that don't have .. [#] Note that the parser only accepts the Unix-style end of line convention.
:cfunc:`setvbuf`. The interface to specify the buffer size is not done using a If you are reading the code from a file, make sure to use newline conversion
method that calls :cfunc:`setvbuf`, because that may dump core when called after mode to convert Windows or Mac-style newlines.
any I/O has been performed, and there's no reliable way to determine whether
this is the case.
.. [#] In the current implementation, local variable bindings cannot normally be .. [#] In the current implementation, local variable bindings cannot normally be
affected this way, but variables retrieved from other scopes (such as modules) affected this way, but variables retrieved from other scopes (such as modules)
can be. This may change. can be. This may change.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment