1.1 --- a/micropython/__init__.py Sun Jun 03 00:42:45 2012 +0200
1.2 +++ b/micropython/__init__.py Sun Jun 03 01:38:14 2012 +0200
1.3 @@ -747,9 +747,18 @@
1.4 if isinstance(parent, Instance):
1.5 for attrvalue in attrvalues:
1.6 for name in objtable.any_possible_objects([attrname]):
1.7 +
1.8 + # Get the parent object using the special
1.9 + # table entry.
1.10 +
1.11 parent = objtable.access(name, "#" + name)
1.12 - if not isinstance(parent, Class) or \
1.13 +
1.14 + # Permit assignment to instance attributes
1.15 + # only.
1.16 +
1.17 + if isinstance(parent, Class) and \
1.18 not parent.instance_attributes().has_key(attrname):
1.19 +
1.20 parent.set(attrname, attrvalue, 0)
1.21 else:
1.22 for attrvalue in attrvalues: