[Python-checkins] r60265 - in python/trunk: Lib/test/test_grammar.py Python/compile.c

Guido van Rossum guido at python.org
Fri Jan 25 00:26:44 CET 2008


On Jan 24, 2008 3:01 PM, Neal Norwitz <nnorwitz at gmail.com> wrote:
> On Jan 24, 2008 2:51 PM, amaury.forgeotdarc <python-checkins at python.org> wrote:
> > Author: amaury.forgeotdarc
> > Date: Thu Jan 24 23:51:18 2008
> > New Revision: 60265
> >
> > Modified:
> >    python/trunk/Lib/test/test_grammar.py
> >    python/trunk/Python/compile.c
> > Log:
> > #1920: when considering a block starting by "while 0", the compiler optimized the
> > 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.
>
> Since this change affects byte code generation, the import magic #
> should be updated for 2.6.  We can't update the magic for 2.5.  For
> more info see Python/import.c or PEP 339.

I don't think so. While the old byte code may be wrong, we're not
introducing new opcodes or changing the semantics of bytecode. So I
don't think MAGIC needs to change.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-checkins mailing list