[New-bugs-announce] [issue4327] Patch: simplify complex constant assignment statements

David Turner report at bugs.python.org
Fri Nov 14 22:47:39 CET 2008


New submission from David Turner <novalis at novalis.org>:

This patch adds functionality to the optimizer to simplify complex
constant assignments like:

a, (b, c) = d, e = 1, (2, 3)

The simplification is:

a = 1
d = 1
b, c = e = 2, 3

Of course, the simplified version is semantically identical.  But the
bytecode generated is faster, because there is less need to unpack
tuples.  Naturally, this only works on constants:

a, b = 1, a is not the same as
a = 1
b = a

----------
files: tlee-ast-optimize-multiassign.diff
keywords: patch
messages: 75889
nosy: novalis_dt
severity: normal
status: open
title: Patch: simplify complex constant assignment statements
Added file: http://bugs.python.org/file12012/tlee-ast-optimize-multiassign.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4327>
_______________________________________


More information about the New-bugs-announce mailing list