diff options
author | Georg Brandl <georg@python.org> | 2009-03-31 16:57:13 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-03-31 16:57:13 (GMT) |
commit | 47f27a346f0eb2bf067e8df2cedf7398985fd1a2 (patch) | |
tree | 0e86a39edc196a4676e55f4c70440701a718d019 /Doc/library/functions.rst | |
parent | b3259a4afe610cee8753ea96d87975851cb4c6ed (diff) | |
download | cpython-47f27a346f0eb2bf067e8df2cedf7398985fd1a2.zip cpython-47f27a346f0eb2bf067e8df2cedf7398985fd1a2.tar.gz cpython-47f27a346f0eb2bf067e8df2cedf7398985fd1a2.tar.bz2 |
Forward-port of #992207 fix: document that the parser only accepts \\n newlines. (And remove a leftover footnote.)
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 73ff99d..7fd39b7 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -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 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 - occurs). If it is a code object, it is simply executed. In all cases, the - code that's executed is expected to be valid as file input (see the section - "File input" in the Reference Manual). Be aware that the :keyword:`return` - and :keyword:`yield` statements may not be used outside of function - definitions even within the context of code passed to the :func:`exec` - function. The return value is ``None``. + occurs). [#]_ If it is a code object, it is simply executed. In all cases, + the code that's executed is expected to be valid as file input (see the + section "File input" in the Reference Manual). Be aware that the + :keyword:`return` and :keyword:`yield` statements may not be used outside of + function definitions even within the context of code passed to the + :func:`exec` function. The return value is ``None``. 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 @@ -1275,13 +1275,10 @@ are always available. They are listed here in alphabetical order. .. rubric:: Footnotes -.. [#] Specifying a buffer size currently has no effect on systems that don't have - :cfunc:`setvbuf`. The interface to specify the buffer size is not done using a - method that calls :cfunc:`setvbuf`, because that may dump core when called after - any I/O has been performed, and there's no reliable way to determine whether - this is the case. +.. [#] Note that the parser only accepts the Unix-style end of line convention. + If you are reading the code from a file, make sure to use newline conversion + mode to convert Windows or Mac-style newlines. .. [#] In the current implementation, local variable bindings cannot normally be affected this way, but variables retrieved from other scopes (such as modules) can be. This may change. - |