# HG changeset patch # User Paul Boddie # Date 1395092130 -3600 # Node ID 23fd8b9aa7ea2d152dc4d8be8ed38b0c0f39f631 # Parent 65649d588488090a2d9338bf568d250d6a6b94b5 Fixed the representation of functions so that tuple arguments are handled. Introduced a separate local attribute representation. diff -r 65649d588488 -r 23fd8b9aa7ea micropython/data.py --- a/micropython/data.py Sat Mar 15 14:17:10 2014 +0100 +++ b/micropython/data.py Mon Mar 17 22:35:30 2014 +0100 @@ -624,14 +624,28 @@ """ context_values = set() + for def_user in self._get_defining_users(): attr = def_user._values[self.name] + + # Attributes provide their values via this local attribute. + if isinstance(attr, BaseAttr): context_values.update(attr.get_context_values()) + + # Non-attributes are propagated using the conversion rule. + else: context_values.add(get_context_and_value(attr)) + return context_values + def __repr__(self): + return "" % ( + shortrepr(self.parent), self.name, + self._repr_parent_type(), self.get_assignments() + ) + class Attr(BaseAttr): "An attribute entry having context and value information." @@ -1233,7 +1247,7 @@ return "" % shortrepr(self) def __shortrepr__(self): - return "%s.%s(%s)" % (shortrepr(self.parent), self.name, ", ".join(self.argnames)) + return "%s.%s(%s)" % (shortrepr(self.parent), self.name, ", ".join([repr(arg) for arg in self.argnames])) def is_lambda(self): return self._is_lambda