On Nov 21, 4:33 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Aaron Brady <[EMAIL PROTECTED]> wrote: > >> a[:] = [1, 2, 3] > > > No, that's not assignment, it's syntactic sugar for a __setslice__ > > call. No copies here. > > Oh dear, perhaps you had better get the Python developers to update the > grammar that Python uses as that seems to think it's an assignment:
Well, the docs don't take my side either. "object.__setitem__(self, key, value) Called to implement assignment to self[key]." But wait, is that true assignment? "Assignment statements Assignment statements are used to (re)bind names to values and to modify attributes or items of mutable objects:" "If the target is an identifier (name): ... the name is bound to the object in the current global namespace." The latter is the case of interest. -- http://mail.python.org/mailman/listinfo/python-list