1.1 --- a/micropython/__init__.py Mon Jun 06 00:48:40 2011 +0200
1.2 +++ b/micropython/__init__.py Wed Jun 08 00:21:12 2011 +0200
1.3 @@ -696,8 +696,21 @@
1.4 # Test for assignment.
1.5
1.6 if attrvalues:
1.7 - for attrvalue in attrvalues:
1.8 - parent.set(attrname, attrvalue, 0)
1.9 +
1.10 + # Instance-related accesses may involve any type
1.11 + # supporting the attribute.
1.12 + # NOTE: Here, an instance actually represents any kind
1.13 + # NOTE: of object.
1.14 +
1.15 + if isinstance(parent, micropython.data.Instance):
1.16 + for attrvalue in attrvalues:
1.17 + for name in objtable.any_possible_objects([attrname]):
1.18 + parent = objtable.access(name, name)
1.19 + if not parent.instance_attributes().has_key(attrname):
1.20 + parent.set(attrname, attrvalue, 0)
1.21 + else:
1.22 + for attrvalue in attrvalues:
1.23 + parent.set(attrname, attrvalue, 0)
1.24
1.25 # Visit attributes of objects known to be used.
1.26