1.1 --- a/micropython/data.py Sun Feb 22 22:31:21 2009 +0100
1.2 +++ b/micropython/data.py Sat Feb 28 01:49:33 2009 +0100
1.3 @@ -20,7 +20,7 @@
1.4
1.5 --------
1.6
1.7 -The central classes in this module are the following:
1.8 +The central data structure classes in this module are the following:
1.9
1.10 * Class
1.11 * Function
1.12 @@ -34,7 +34,7 @@
1.13 access names within their defined scopes. Specific methods also exist in order
1.14 to distinguish between certain kinds of attributes:
1.15
1.16 - * Class: (class|all_class|instance|all)_attributes
1.17 + * Class: class_attributes, all_class_attributes, instance_attributes, all_attributes
1.18 * Function: parameters, locals, all_locals
1.19 * Module: module_attributes
1.20
1.21 @@ -101,7 +101,7 @@
1.22 self.module.set(name, value, 0)
1.23 else:
1.24 attr = self._set(name, value)
1.25 - attr.update(attr.value, single_assignment)
1.26 + attr.update(value, single_assignment)
1.27
1.28 def set_module(self, name, value):
1.29
1.30 @@ -310,7 +310,7 @@
1.31 self.name, shortrepr(self.value), self.assignments
1.32 )
1.33
1.34 - def as_raw(self, objtable):
1.35 + def as_raw(self, objtable, paramtable):
1.36 return [
1.37 (
1.38 self.context and self.context.location,
1.39 @@ -365,7 +365,7 @@
1.40
1.41 __shortrepr__ = __repr__
1.42
1.43 - def as_raw(self, objtable):
1.44 + def as_raw(self, objtable, paramtable):
1.45 # NOTE: Need class details!
1.46 return [
1.47 DataObject(
1.48 @@ -461,7 +461,7 @@
1.49 def __shortrepr__(self):
1.50 return "Class(%r, %s)" % (self.name, shortrepr(self.parent))
1.51
1.52 - def as_raw(self, objtable):
1.53 + def as_raw(self, objtable, paramtable):
1.54 classcode = objtable.as_list().get_code(self.full_name())
1.55 attrcode = objtable.get_index(self.full_name())
1.56
1.57 @@ -861,7 +861,7 @@
1.58 self.name, shortrepr(self.parent)
1.59 )
1.60
1.61 - def as_raw(self, objtable):
1.62 + def as_raw(self, objtable, paramtable):
1.63 # NOTE: Need class and parameter details! Should arguably be types.FunctionType.
1.64 return [
1.65 DataObject(
1.66 @@ -873,7 +873,8 @@
1.67 len(self.defaults)
1.68 ),
1.69 0,
1.70 - "__builtins__.function"
1.71 + "__builtins__.function",
1.72 + paramtable.as_list().get_code(self.full_name())
1.73 )
1.74 ]
1.75
1.76 @@ -1065,7 +1066,7 @@
1.77 def __shortrepr__(self):
1.78 return "Module(%r)" % self.name
1.79
1.80 - def as_raw(self, objtable):
1.81 + def as_raw(self, objtable, paramtable):
1.82 return [
1.83 DataObject(
1.84 objtable.as_list().get_code(self.full_name()),