Message74713
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 |
|
Date |
User |
Action |
Args |
2008-10-13 23:19:19 | terry.reedy | set | recipients:
+ terry.reedy, zseil, oripel |
2008-10-13 23:19:18 | terry.reedy | set | messageid: <1223939958.92.0.307454133667.issue1479099@psf.upfronthosting.co.za> |
2008-10-13 23:19:16 | terry.reedy | link | issue1479099 messages |
2008-10-13 23:19:16 | terry.reedy | create | |
|