On Sat, 13 Nov 2010 21:42:03 +0000, Mark Wooding wrote: > Dave Angel <da...@ieee.org> writes: > >> No, an (=) assignment is always an assignment. > > No. In `foo[0] = bar' it's a method call in disguise.
How does that imply that can't also be an assignment? Of course, you're correct that it's not *necessarily* an assignment, if the type of foo is a pathological or broken class that does weird things on __setitem__. We tend to gloss over that in discussions, in the same way that we gloss over the fact that: len([1,2,3]) does not necessarily return 3, but could in fact do *anything*, depending on whether or not len is still the built-in function or not. I don't think it helps to overload newbies struggling with the basics with such pathological cases though. -- Steven -- http://mail.python.org/mailman/listinfo/python-list