Staging
v0.5.1
https://github.com/python/cpython
Revision f1a7178cd569383cbce3aba22bd7b1d5950e7c20 authored by Amaury Forgeot d'Arc on 24 January 2008, 23:42:08 UTC, committed by Amaury Forgeot d'Arc on 24 January 2008, 23:42:08 UTC
whole construct away, even when an 'else' clause is present::

    while 0:
        print("no")
    else:
        print("yes")

did not generate any code at all.

Now the compiler emits the 'else' block, like it already does for 'if' statements.

Backport of r60265.
1 parent d933e0a
History
Tip revision: f1a7178cd569383cbce3aba22bd7b1d5950e7c20 authored by Amaury Forgeot d'Arc on 24 January 2008, 23:42:08 UTC
#1920: when considering a block starting by "while 0", the compiler optimized the
Tip revision: f1a7178
File Mode Size
Demo
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
PCbuild8
Parser
Python
RISCOS
Tools
.hgtags -rw-r--r-- 3.4 KB
LICENSE -rw-r--r-- 13.4 KB
Makefile.pre.in -rw-r--r-- 34.6 KB
README -rw-r--r-- 53.8 KB
configure -rwxr-xr-x 612.3 KB
configure.in -rw-r--r-- 96.1 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 26.6 KB
setup.py -rw-r--r-- 67.2 KB

README

back to top