diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-11-12 23:39:44 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-11-12 23:39:44 (GMT) |
commit | e36199b49df77c96bad687c6681d8e54c5053b84 (patch) | |
tree | 81b9aaa74f92b9de459ede5dc6ed2ca4ec508998 /Doc | |
parent | c4cd6d3765d054ac1b23f0f9765a2eaf3f1e7be7 (diff) | |
download | cpython-e36199b49df77c96bad687c6681d8e54c5053b84.zip cpython-e36199b49df77c96bad687c6681d8e54c5053b84.tar.gz cpython-e36199b49df77c96bad687c6681d8e54c5053b84.tar.bz2 |
fix several compile() issues by translating newlines in the tokenizer
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/functions.rst | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index ff7c4b6..ddece5a 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -173,11 +173,10 @@ available. They are listed here in alphabetical order. .. note:: - When compiling a string with multi-line statements, line endings must be - represented by a single newline character (``'\n'``), and the input must - be terminated by at least one newline character. If line endings are - represented by ``'\r\n'``, use :meth:`str.replace` to change them into - ``'\n'``. + When compiling a string with multi-line statements in ``'single'`` or + ``'eval'`` mode, input must be terminated by at least one newline + character. This is to facilitate detection of incomplete and complete + statements in the :mod:`code` module. .. versionchanged:: 2.3 The *flags* and *dont_inherit* arguments were added. @@ -185,6 +184,10 @@ available. They are listed here in alphabetical order. .. versionchanged:: 2.6 Support for compiling AST objects. + .. versionchanged:: 2.7 + Allowed use of Windows and Mac newlines. Also input in ``'exec'`` mode + does not have to end in a newline anymore. + .. function:: complex([real[, imag]]) |