1.1 --- a/TO_DO.txt Mon May 09 00:56:35 2011 +0200
1.2 +++ b/TO_DO.txt Tue May 10 00:48:24 2011 +0200
1.3 @@ -4,8 +4,6 @@
1.4 Verify that the context information is correctly set, particularly for the unoptimised
1.5 cases.
1.6
1.7 - Allow module types to be tested in guards.
1.8 -
1.9 Update docs/assignment.txt.
1.10
1.11 Dynamic Attribute Access
2.1 --- a/micropython/__init__.py Mon May 09 00:56:35 2011 +0200
2.2 +++ b/micropython/__init__.py Tue May 10 00:48:24 2011 +0200
2.3 @@ -265,7 +265,13 @@
2.4
2.5 t = self.objtable = micropython.table.ObjectTable()
2.6 for module in self.importer.get_modules():
2.7 - t.add(module.full_name(), module.module_attributes())
2.8 +
2.9 + # Add module attributes and module identity information.
2.10 +
2.11 + full_name = module.full_name()
2.12 + attributes = {full_name : module}
2.13 + attributes.update(module.module_attributes())
2.14 + t.add(full_name, attributes)
2.15
2.16 # Add class and instance attributes for all classes, together
2.17 # with descendant information.
2.18 @@ -276,8 +282,8 @@
2.19 # Prevent ambiguous classes.
2.20
2.21 full_name = obj.full_name()
2.22 - name = obj.name
2.23
2.24 + #name = obj.name
2.25 #if module.has_key(name) and module[name].defines_ambiguous_class():
2.26 # raise TableGenerationError, "Class %r in module %r is ambiguously defined." % (name, module.full_name())
2.27
3.1 --- a/micropython/table.py Mon May 09 00:56:35 2011 +0200
3.2 +++ b/micropython/table.py Tue May 10 00:48:24 2011 +0200
3.3 @@ -172,7 +172,7 @@
3.4
3.5 # Support descendants.
3.6
3.7 - if isinstance(attr, Class):
3.8 + if isinstance(attr, (Class, Module)):
3.9 return (attr_index, None, None)
3.10
3.11 # Get the absolute location for classes and modules.