John O'Hagan <resea...@johnohagan.com> wrote: >I can see that it's tantalizing, though, because _somebody_ must know about >the assignment; after all, we just executed it!
Except we haven't, if we're talking about reporting from the object's __init__: >>> class Brian: ... def __init__(self): ... print "I'm Brian!" ... >>> l = [] >>> l[1] = Brian() I'm Brian! Traceback (most recent call last): File "<stdin>", line 1, in <module> IndexError: list assignment index out of range (Yeah, I know that's a setitem call not an assignment. Point stands. It also demonstrates why the whole idea of "what name is a newly- created object assigned to" is broken.) -- \S under construction -- http://mail.python.org/mailman/listinfo/python-list