This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients oripel, terry.reedy, zseil
Date 2008-10-13.23:19:16
SpamBayes Score 9.724251e-06
Marked as misclassified No
Message-id <1223939958.92.0.307454133667.issue1479099@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2008-10-13 23:19:19terry.reedysetrecipients: + terry.reedy, zseil, oripel
2008-10-13 23:19:18terry.reedysetmessageid: <1223939958.92.0.307454133667.issue1479099@psf.upfronthosting.co.za>
2008-10-13 23:19:16terry.reedylinkissue1479099 messages
2008-10-13 23:19:16terry.reedycreate