2006-10-08 | paulb | raw files shortlog changelog graph | Made a nicer repr output for Instance. | |
simplified.py (file) |
1.1 --- a/simplified.py Sun Oct 08 18:46:55 2006 +0200 1.2 +++ b/simplified.py Sun Oct 08 23:53:35 2006 +0200 1.3 @@ -304,7 +304,12 @@ 1.4 Structure.__init__(self, *args, **kw) 1.5 WithName.__init__(self) 1.6 1.7 -class Instance(Structure): "An instance." 1.8 +class Instance(Structure): 1.9 + 1.10 + "An instance." 1.11 + 1.12 + def __repr__(self): 1.13 + return "Instance of type '%s'" % self.namespace.load("__class__")[0].type.full_name 1.14 1.15 class Constant(Instance): 1.16