# HG changeset patch # User Paul Boddie # Date 1253831717 -7200 # Node ID 25c1660165dbf171b3a187204951a0af4ff2d0f8 # Parent 11aaa493c62886ee8c3577174dd07af9519bbd19 Added __name__ attribute definition to each module. Added more int method declarations. diff -r 11aaa493c628 -r 25c1660165db lib/builtins.py --- a/lib/builtins.py Thu Sep 24 21:29:29 2009 +0200 +++ b/lib/builtins.py Fri Sep 25 00:35:17 2009 +0200 @@ -106,6 +106,8 @@ def __init__(self, number_or_string=None): pass def __iadd__(self, other): pass def __isub__(self, other): pass + def __iand__(self, other): pass + def __ior__(self, other): pass def __add__(self, other): pass def __radd__(self, other): pass def __sub__(self, other): pass @@ -136,6 +138,10 @@ def __pos__(self): pass def __str__(self): pass def __bool__(self): pass + def __lshift__(self): pass + def __rlshift__(self): pass + def __rshift__(self): pass + def __rrshift__(self): pass class list(object): def __init__(self, args=()): pass diff -r 11aaa493c628 -r 25c1660165db micropython/inspect.py --- a/micropython/inspect.py Thu Sep 24 21:29:29 2009 +0200 +++ b/micropython/inspect.py Fri Sep 25 00:35:17 2009 +0200 @@ -129,6 +129,14 @@ self.astnode = self.module = module + # Add __name__ to the namespace by adding an explicit assignment to the + # module. + + module.node.nodes.insert(0, compiler.ast.Assign( + [compiler.ast.AssName("__name__", 0)], + compiler.ast.Const(self.full_name()) + )) + # First, visit module-level code, recording global names. processed = self.dispatch(module)