Trouble when overloading operator[ ]

Greg Ewing see at my.signature
Mon Jul 24 01:28:07 EDT 2000


You may know already, but I just thought I'd mention
that you can use this trick to make the implementation
of your 2-index __getitem__ function look nice:

   class MyClass:
     def __getitem__(self, (x,y)):
       ...

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list