Overloading __getitem__

inhahe inhahe at gmail.com
Thu May 22 20:01:01 EDT 2008


> Apparently, args already is a tuple, so this should be:
>
>  def __getitem__(self, args):
>
> Is this documented somewhere? I couldn't find it anywhere.
>

Don't know, I just assumed it would take multiple arguments because I knew I 
had seen the form d[1,2] before, which incidentally is equivalent to 
d[(1,2)] so  I guess it makes sense that args is a tuple.






More information about the Python-list mailing list