1.1 --- a/micropython/__init__.py Sat Mar 22 22:31:54 2008 +0100
1.2 +++ b/micropython/__init__.py Mon Mar 24 23:53:18 2008 +0100
1.3 @@ -62,7 +62,7 @@
1.4
1.5 self.path = path or [os.getcwd()]
1.6 self.verbose = verbose
1.7 - self.modules = {"__builtins__" : micropython.inspect.builtins}
1.8 + self.modules = {}
1.9 self.loading = set()
1.10
1.11 # Remember the tables once generated.
1.12 @@ -115,7 +115,7 @@
1.13 # Position the module in the image and make a translation.
1.14
1.15 module.location = pos
1.16 - trans = micropython.ast.Translation(module, objtable, paramtable)
1.17 + trans = micropython.ast.Translation(module, objtable, paramtable, self.modules.get("__builtins__"))
1.18
1.19 # Add header details.
1.20
1.21 @@ -222,12 +222,11 @@
1.22 t.add(obj.full_name(), obj.parameters())
1.23
1.24 # Classes are callable, too.
1.25 - # Copy details of the appropriate __init__ method to make an
1.26 - # entry for the class.
1.27 + # Take details of the appropriate __init__ method to make an
1.28 + # entry for an instantiation function for the class.
1.29
1.30 elif isinstance(obj, micropython.inspect.Class):
1.31 - init_method = objtable.table[obj.full_name()]["__init__"].value
1.32 - t.add(obj.full_name(), init_method.parameters())
1.33 + t.add(obj.full_name(), obj.get_instantiator().parameters())
1.34
1.35 return self.paramtable
1.36