1.1 --- a/simplified.py Sun Jul 30 16:15:57 2006 +0200
1.2 +++ b/simplified.py Mon Jul 31 01:01:34 2006 +0200
1.3 @@ -159,7 +159,7 @@
1.4 class LoadName(Node): "Load a named object."
1.5 class LoadGlobal(Node): "Load a named global object."
1.6 class LoadAttr(Node): "Load an object attribute."
1.7 -class LoadRef(Node): "Load a reference, typically a subprogram."
1.8 +class LoadRef(Node): "Load a reference, typically a subprogram or a constant."
1.9 class LoadExc(Node): "Load a handled exception."
1.10 class StoreTemp(Node): "Store a temporary value."
1.11 class StoreName(Node): "Associate a name with an object."
1.12 @@ -188,8 +188,24 @@
1.13 else:
1.14 return "%s (at %x)" % (self.__class__, id(self))
1.15
1.16 -class Class(Structure): "A Python class."
1.17 -class Instance(Structure): "An instance."
1.18 -class Constant(Instance): "A constant."
1.19 +class Class(Structure):
1.20 +
1.21 + "A Python class."
1.22 +
1.23 +class Instance(Structure):
1.24 +
1.25 + "An instance."
1.26 +
1.27 + def __init__(self, **kw):
1.28 + Structure.__init__(self, **kw)
1.29 + self.types = [self]
1.30 +
1.31 +class Constant(Instance):
1.32 +
1.33 + "A constant initialised with a type name for future processing."
1.34 +
1.35 + def __init__(self, **kw):
1.36 + Instance.__init__(self, **kw)
1.37 + self.typename = self.value.__class__.__name__
1.38
1.39 # vim: tabstop=4 expandtab shiftwidth=4