1.1 --- a/micropython/inspect.py Sat Oct 26 01:55:16 2013 +0200
1.2 +++ b/micropython/inspect.py Sat Oct 26 20:10:34 2013 +0200
1.3 @@ -676,7 +676,7 @@
1.4
1.5 # Attempt to identify the nature of the attribute.
1.6
1.7 - if isinstance(expr, Attr):
1.8 + if isinstance(expr, BaseAttr):
1.9 value = expr.get_value()
1.10
1.11 # Get the attribute and record its usage.
1.12 @@ -861,7 +861,7 @@
1.13
1.14 # Record the attribute on the presumed target.
1.15
1.16 - if isinstance(expr, Attr):
1.17 + if isinstance(expr, BaseAttr):
1.18 value = expr.get_value()
1.19
1.20 if expr.name == "self":
1.21 @@ -927,7 +927,7 @@
1.22 # NOTE: this is merely creating aliases for such methods.
1.23
1.24 if isinstance(self.get_namespace(), (Class, Module)):
1.25 - if not isinstance(self.expr, Attr) or not isinstance(self.expr.get_value(), Function):
1.26 + if not isinstance(self.expr, BaseAttr) or not isinstance(self.expr.get_value(), Function):
1.27 self.use_specific_attribute(None, node.name)
1.28 else:
1.29 fn = self.expr.get_value()
1.30 @@ -1009,7 +1009,7 @@
1.31
1.32 # Each base class must be constant and known at compile-time.
1.33
1.34 - if isinstance(expr, Attr):
1.35 + if isinstance(expr, BaseAttr):
1.36 if expr.assignments != 1:
1.37 raise InspectError("Base class %r for %r is not constant: %r" % (base, cls.full_name(), expr))
1.38 elif not isinstance(expr.get_value(), Class):
1.39 @@ -1033,8 +1033,8 @@
1.40 # Make an entry for the class in the parent namespace.
1.41
1.42 self.namespaces.pop()
1.43 + self.define_attribute_user(node)
1.44 self.store(node.name, cls, static_def=True)
1.45 - self.define_attribute_user(node)
1.46 self.add_object(cls)
1.47
1.48 # Process the class body in its own namespace.