# HG changeset patch # User Paul Boddie # Date 1338680294 -7200 # Node ID 20ea2e9b841de3477e0f7359b3c5aef3d926c2d6 # Parent b0f8c2d66579a2389eb4d3c4e81b806d144834e6 Restricted attribute assignments observed through usage analysis to instance attributes only. diff -r b0f8c2d66579 -r 20ea2e9b841d micropython/__init__.py --- a/micropython/__init__.py Sun Jun 03 00:42:45 2012 +0200 +++ b/micropython/__init__.py Sun Jun 03 01:38:14 2012 +0200 @@ -747,9 +747,18 @@ if isinstance(parent, Instance): for attrvalue in attrvalues: for name in objtable.any_possible_objects([attrname]): + + # Get the parent object using the special + # table entry. + parent = objtable.access(name, "#" + name) - if not isinstance(parent, Class) or \ + + # Permit assignment to instance attributes + # only. + + if isinstance(parent, Class) and \ not parent.instance_attributes().has_key(attrname): + parent.set(attrname, attrvalue, 0) else: for attrvalue in attrvalues: