Trouble when overloading operator[ ]

Grant Edwards ge at nowhere.none
Thu Jul 20 13:24:59 EDT 2000


In article <8l76hm$pm9$1 at nnrp1.deja.com>, david_ullrich at my-deja.com wrote:

>   You can use the notation [2,3] to accomplish the same
>thing: it appears that if you use multiple indices they
>get passed as a tuple to __getitem__:

You're not using multiple indices.  

You're using a single index whose value is the expression 2,3.
The expression 2,3 evaluates to a tuple, which is passed to
_getitem__, just as would the value of any other expression
used as an index.

-- 
Grant Edwards                   grante             Yow!  My Aunt MAUREEN was
                                  at               a military advisor to IKE &
                               visi.com            TINA TURNER!!



More information about the Python-list mailing list