Terry J. Reedy <[EMAIL PROTECTED]> added the comment: As near as I can tell, for 2.5.2 and 3.0c1, the limitation on compile only applies when the last line only contains a comment.
>>> print (compile("def f():\n pass #haha",'','exec')) <code object <module> at 00AADAD0, file "", line 1> >>> print (compile("def f():\n pass\n#haha",'','exec')) # or >>> print (compile("def f():\n pass\n #haha",'','exec')) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "", line 3 #haha I would prefer more consistent behavior. I have opened a separate doc issue that includes the documentation of this issue. http://bugs.python.org/issue4118 ---------- nosy: +tjreedy versions: +Python 2.6, Python 2.7, Python 3.0 _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1479099> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com