__getitem__ used in a for loop : Getitem : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Getitem »

 

__getitem__ used in a for loop


class MyRange:
   def __init__self, start, stop, step ):
      self.sequence = rangestart, stop, step )

   def __getitem__self, subscript ):
      return self.sequencesubscript ]



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Class
» Getitem