Add "lazy lists" assignment support (mylist[index] = value).

Add support for LAMBDA (empty) tree nodes while on it, that allow us to define private stuff at the top without caring about Loc.
This commit is contained in:
Sei Lisa 2015-03-03 17:59:51 +01:00
parent 7e521780d6
commit b73805e0ce
4 changed files with 75 additions and 19 deletions

View file

@ -1015,9 +1015,10 @@ class foldconst(object):
node['SEF'] = True
return
if nt in ('JUMP', '@', 'V++', 'V--', '--V', '++V'):
# These all have side effects, as in, can't be eliminated as
# statements.
if nt in ('JUMP', '@', 'V++', 'V--', '--V', '++V', 'LAMBDA'):
# Except LAMBDA, these all have side effects, as in, can't be
# eliminated as statements.
# LAMBDA can't be eliminated without scrolling Loc's.
return
assert False, 'Internal error: This should not happen, node type = ' \