1.1 --- a/micropython/deduce.py Thu Mar 13 23:10:25 2014 +0100
1.2 +++ b/micropython/deduce.py Thu Mar 13 23:54:49 2014 +0100
1.3 @@ -272,12 +272,16 @@
1.4 if not node._expr or isinstance(node._expr, Instance):
1.5 node._expr = expr_type
1.6
1.7 - # The target, on which the access is performed, may influence the effect
1.8 - # on the context. We can only reliably assume that a literal constant is
1.9 - # an instance: all other "instances" may actually be classes in certain
1.10 - # cases.
1.11 + self._annotateAttr(node, node._expr, node.attrname)
1.12 +
1.13 + # Make a summary annotation of the deductions.
1.14
1.15 - self._annotateAttr(node, node._expr, node.attrname)
1.16 + attributes = node._value_deduced and [self.get_attribute_and_value(node._value_deduced)] or \
1.17 + node._attr_deduced and [self.get_attribute_and_value(node._attr_deduced)] or \
1.18 + node._attrs_deduced or \
1.19 + map(self.get_attribute_and_value, node._attrs_deduced_from_specific_usage or [])
1.20 +
1.21 + node._access_attrs = attributes
1.22
1.23 def _annotateAttr(self, node, target, attrname):
1.24
1.25 @@ -288,6 +292,11 @@
1.26
1.27 unit = self.get_unit()
1.28
1.29 + # The target, on which the access is performed, may influence the effect
1.30 + # on the context. We can only reliably assume that a literal constant is
1.31 + # an instance: all other "instances" may actually be classes in certain
1.32 + # cases.
1.33 +
1.34 instance_target = isinstance(target, TypedInstance)
1.35 typed_instance_attr = isinstance(target, BaseAttr) and isinstance(target.get_value(), TypedInstance)
1.36 self_access = self.provides_self_access(target, unit)