1.1 --- a/micropython/common.py Tue Mar 27 23:30:19 2012 +0200
1.2 +++ b/micropython/common.py Tue Apr 24 23:51:15 2012 +0200
1.3 @@ -85,7 +85,7 @@
1.4
1.5 def add(self, obj):
1.6 if not self.has_key(obj):
1.7 - self[obj] = []
1.8 + self[obj] = set()
1.9
1.10 # Dictionary and related methods.
1.11
1.12 @@ -116,7 +116,7 @@
1.13
1.14 if hasattr(other, "items"):
1.15 for key, value in other.items():
1.16 - self[key] = value + self.get(key, [])
1.17 + self[key] = add_sets(value, self.get(key, []))
1.18
1.19 # Combining sequence-like objects involves just adding members.
1.20
1.21 @@ -131,7 +131,7 @@
1.22 possible, and incorporating values present in only one of the sets.
1.23 """
1.24
1.25 - return combine(self, other, ObjectSet(), operator.add)
1.26 + return combine(self, other, ObjectSet(), add_sets)
1.27
1.28 def deepen_mapping_dict(d):
1.29
1.30 @@ -258,6 +258,9 @@
1.31 combined.add(i1.merge(i2))
1.32 return combined
1.33
1.34 +def add_sets(s1, s2):
1.35 + return set(list(s1) + list(s2))
1.36 +
1.37 # Visitors and activities related to node annotations.
1.38
1.39 class ASTVisitor(compiler.visitor.ASTVisitor):
2.1 --- a/micropython/data.py Tue Mar 27 23:30:19 2012 +0200
2.2 +++ b/micropython/data.py Tue Apr 24 23:51:15 2012 +0200
2.3 @@ -567,7 +567,7 @@
2.4
2.5 values.add(attrname)
2.6 if value is not None:
2.7 - values[attrname].append(value)
2.8 + values[attrname].add(value)
2.9
2.10 return users[name]
2.11 else: