[issue1920] while else loop seems to behave incorrectly

2008-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Forgot to say: Amaury checked his fix in in revision #60265 (trunk) and revision #60268 (Python 2.5). Thanks for the bug report, Mark! __ Tracker <[EMAIL PROTECTED]> __

[issue1920] while else loop seems to behave incorrectly

2008-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Looks like Amaury found his svn access. Is it okay to close this now? -- resolution: -> accepted status: open -> closed __ Tracker <[EMAIL PROTECTED]> _

[issue1920] while else loop seems to behave incorrectly

2008-01-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Here is a patch, made against py3k; it should apply cleanly to the trunk. On the 2.5 branch, compile.c seems identical, but test_grammar.py looks very different; the conversion should be easy. Can someone review and apply it? I don't have svn access at th

[issue1920] while else loop seems to behave incorrectly

2008-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: This bug is also present in the trunk, with while 0 instead of while False. This appears closely related to issue #1875. In my opinion this is a serious bug in the core language. I'm not sure whether it's serious enough to be considered a showstopper for 2.5

[issue1920] while else loop seems to behave incorrectly

2008-01-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: python 2.5 has the same behaviour, if you use "while 0:" instead. In compiler.c, there is code that optimizes away blocks like "if 0", "while 0". 'if' correctly emit the else clause, 'while' does not... -- nosy: +amaury.forgeotdarc ___

[issue1920] while else loop seems to behave incorrectly

2008-01-24 Thread Mark Summerfield
New submission from Mark Summerfield: I am using: Python 3.0a2 (r30a2:59382, Dec 17 2007, 08:47:22) [GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2 IDLE 3.0a1 This seems wrong: >>> while False: print("no") else: print("yes") >>> I expected it to print "yes" beca