Thomas Kluyver added the comment:

Hmm, that's interesting.

For our purposes, a blank line or a comment line shouldn't result in a 
continuation prompt. This is consistent with what the plain Python shell does.

As part of this, we're tokenizing the code, and if the final \n results in a NL 
token (instead of NEWLINE), we wait to build a 'Python line'. (Likewise if the 
final \n doesn't appear before EOFError, indicating that a string continues to 
the next line). Since tokenize doesn't expose parenlev (parentheses level), my 
modification to tokenize makes this work as we need.

Maybe another way forward would be to make parenlev accessible in some way, so 
that we can use that rather than using NL == parenlev > 0?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17061>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to