* Kay Schluehr wrote: > you might initialize self.storedAttr with empty dicts and fill them > later: > > self.soredAttr = [{}]*10 > for entry in self.storedAttr: > entry.update(self.drawAttr)
As a matter of fact, you're doing the same ;-) In [1]: x = [{}] * 10 In [2]: x[0]['a'] = 1 In [3]: x[1]['b'] = 2 In [4]: x Out[4]: [{'a': 1, 'b': 2}, {'a': 1, 'b': 2}, {'a': 1, 'b': 2}, {'a': 1, 'b': 2}, {'a': 1, 'b': 2}, {'a': 1, 'b': 2}, {'a': 1, 'b': 2}, {'a': 1, 'b': 2}, {'a': 1, 'b': 2}, {'a': 1, 'b': 2}] nd -- "Umfassendes Werk (auch fuer Umsteiger vom Apache 1.3)" -- aus einer Rezension <http://pub.perlig.de/books.html#apache2> -- http://mail.python.org/mailman/listinfo/python-list