[issue12705] Make compile('1\n2\n', '', 'single') raise an exception instead of silently truncating?

Meador Inge report at bugs.python.org
Tue Jan 17 20:20:34 CET 2012


Meador Inge <meadori at gmail.com> added the comment:

On Tue, Jan 17, 2012 at 10:56 AM, Éric Araujo <report at bugs.python.org> wrote:

> I don’t understand why some two-liners are allowed (like "class X:\n pass").  The doc says “a single interactive statement”.

Because a single statement can be multiple lines (as is the case for
compound statements).  Look at the grammar for a single input
statement
(interactive_input):
http://docs.python.org/dev/reference/toplevel_components.html#interactive-input.
 This issue is really about multiple statements
and not multiple lines.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12705>
_______________________________________


More information about the Python-bugs-list mailing list