# HG changeset patch # User Paul Boddie # Date 1338766705 -7200 # Node ID 1af8032d9f883bec8f4afac0a5484636864e5d87 # Parent 1114731b6e1e70e12f3923e4e21ca15cd99e9071 Allow usage of instance attributes as declarations, permitting external initialisation of such attributes. diff -r 1114731b6e1e -r 1af8032d9f88 micropython/inspect.py --- a/micropython/inspect.py Mon Jun 04 01:20:39 2012 +0200 +++ b/micropython/inspect.py Mon Jun 04 01:38:25 2012 +0200 @@ -514,6 +514,12 @@ # to be an instance. else: + + # Record any instance attributes. + + if expr.name == "self": + self.store_instance_attr(attrname) + attr = make_instance() # Note usage of the attribute where a local is involved.