New submission from Eric Smith <e...@trueblade.com>: The documentation says: "If the referenced object does not have a, b and c attributes, of course, the end result is still a run-time exception."
For the given example, this is likely not true. Since the attributes are being assigned to, they will be created. The example is equivalent to: >>> class a(object): pass ... >>> ref = a() >>> ref.a = 21 >>> ref.b = 42 >>> ref.c = 63 ---------- assignee: georg.brandl components: Documentation messages: 96291 nosy: eric.smith, georg.brandl severity: normal status: open title: Error in FAQ entry '4.25 Why doesn't Python have a "with" statement for attribute assignments?' versions: Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7485> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com