# HG changeset patch # User paulb@localhost.localdomain # Date 1169595987 -3600 # Node ID 202b9902f214f7e5c72c367ca443592102ab031a # Parent 81c7b970881801fac2382f2b4f39194173667ac2 Made syscount multiple instance capable. Added __hash__ for Attribute for possible future use. diff -r 81c7b9708818 -r 202b9902f214 annotate.py --- a/annotate.py Mon Jan 22 01:29:15 2007 +0100 +++ b/annotate.py Wed Jan 24 00:46:27 2007 +0100 @@ -450,7 +450,6 @@ if isinstance(attr.type, Class): # Instantiate the class. - # NOTE: Should probably only allocate a single instance. instance = self.new_instance(invoke, "new", attr.type.full_name(), attr.type) @@ -917,13 +916,15 @@ # Test to see if anything has changed. - if hasattr(invoke, "syscount") and invoke.syscount == self.system.count: + if hasattr(invoke, "syscount") and invoke.syscount.has_key(target) and invoke.syscount[target] == self.system.count: return # Remember the state of the system. else: - invoke.syscount = self.system.count + if not hasattr(invoke, "syscount"): + invoke.syscount = {} + invoke.syscount[target] = self.system.count # Provide the correct namespace for the invocation. # This may be a "shared" namespace... diff -r 81c7b9708818 -r 202b9902f214 simplified.py --- a/simplified.py Mon Jan 22 01:29:15 2007 +0100 +++ b/simplified.py Wed Jan 24 00:46:27 2007 +0100 @@ -609,6 +609,9 @@ def __repr__(self): return "Attribute(%s, %s)" % (repr(self.context), repr(self.type)) + def __hash__(self): + return id(self) + class Self: """