1.1 --- a/micropython/__init__.py Mon Jun 14 01:46:42 2010 +0200
1.2 +++ b/micropython/__init__.py Tue Jun 15 00:50:51 2010 +0200
1.3 @@ -366,7 +366,7 @@
1.4
1.5 # Attribute usage.
1.6
1.7 - self.attributes_used = {}
1.8 + self.attributes_used = set()
1.9 self.name_references = {}
1.10 self.specific_name_references = {}
1.11 self.attribute_users_visited = set()
1.12 @@ -466,14 +466,14 @@
1.13
1.14 # Name accounting products.
1.15
1.16 - def uses_attribute(self, obj, name):
1.17 + def uses_attribute(self, objname, name):
1.18
1.19 """
1.20 - Return whether the attribute of object 'obj' having the given 'name' is
1.21 - used as an attribute in the program.
1.22 + Return whether the attribute of the object with the given 'objname'
1.23 + having the given 'name' is used as an attribute in the program.
1.24 """
1.25
1.26 - return name in self.attributes_used.get(obj.full_name(), [])
1.27 + return (objname + "." + name) in self.attributes_used
1.28
1.29 def use_attribute(self, objname, name):
1.30
1.31 @@ -482,9 +482,7 @@
1.32 the given 'name' is used.
1.33 """
1.34
1.35 - if not self.attributes_used.has_key(objname):
1.36 - self.attributes_used[objname] = set()
1.37 - self.attributes_used[objname].add(name)
1.38 + self.attributes_used.add(objname + "." + name)
1.39
1.40 def collect_attributes(self, objtable):
1.41