On Monday 27 November 2006 11:50, Fredrik Lundh wrote: > "obj[index] = value" maps to "obj.__setitem__(index, value)". reading > the documentation might help; start here: > > http://docs.python.org/ref/specialnames.html
In this documentation page it also says: --snip--- then x[i] is equivalent3.2 to x.__getitem__(i). --snip-- This, and other statements, are only roughly true for instances of new-style classes. --snip-- So which statements are actually true for new style classes? Is l[0]=1 completely different from l.append(1) or maybe insert? And is there a mechanism in Python that will allow me to override the operators of a class, for all its occurrences, even the ones implemented on C built-in objects? -- Michalis Giannakidis -- http://mail.python.org/mailman/listinfo/python-list