# HG changeset patch # User paulb@localhost.localdomain # Date 1180567692 -7200 # Node ID f74f54f3edb374c192d1c3484e3ce28c2de60b1e # Parent 55ec3799ad4e7cb653445bc9fbcd5123bf8566f2 Fixed the absence of the nodes attribute in simplified node copying. Fixed the builtins, removing artifacts of list-based tuples and other historical mechanisms. diff -r 55ec3799ad4e -r f74f54f3edb3 lib/builtins.py --- a/lib/builtins.py Tue May 29 02:47:40 2007 +0200 +++ b/lib/builtins.py Thu May 31 01:28:12 2007 +0200 @@ -477,16 +477,14 @@ def __getslice__(self, start, end=None): if -len(self) <= start < len(self) and -len(self) <= end < len(self) and start <= end: - return list(self.value) + return [self.value] else: - raise IndexError, index + return [] def __setslice__(self, start, end, slice): - if -len(self) <= start < len(self) and -len(self) <= end < len(self) and start <= end: - for value in slice: - self.value = value - else: - raise IndexError, index + #if -len(self) <= start < len(self) and -len(self) <= end < len(self) and start <= end: + for value in slice: + self.value = value def append(self, value): self.value = value @@ -805,24 +803,11 @@ else: raise IndexError, index - def __setitem__(self, index, value): - if -len(self) <= index < len(self): - self.value = value - else: - raise IndexError, index - def __getslice__(self, start, end=None): if -len(self) <= start < len(self) and -len(self) <= end < len(self) and start <= end: - return list(self.value) + return (self.value,) else: - raise IndexError, index - - def __setslice__(self, start, end, slice): - if -len(self) <= start < len(self) and -len(self) <= end < len(self) and start <= end: - for value in slice: - self.value = value - else: - raise IndexError, index + return () def __len__(self): return int() diff -r 55ec3799ad4e -r f74f54f3edb3 simplify/simplified/program.py --- a/simplify/simplified/program.py Tue May 29 02:47:40 2007 +0200 +++ b/simplify/simplified/program.py Thu May 31 01:28:12 2007 +0200 @@ -71,7 +71,7 @@ expression_attributes = "expr", "lvalue", "test" argument_attributes = "star", "dstar" invocation_attributes = "params", # not "args" - see "pos_args", "kw_args" - grouping_attributes = "code", "body", "else_", "handler", "finally_", "choices" + grouping_attributes = "code", "body", "else_", "handler", "finally_", "choices", "nodes" def __init__(self, original=None, defining=0, **kw):