__getitem__ Intercepts Index References : Getitem : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Getitem »

 

__getitem__ Intercepts Index References


class indexer: 
    def __getitem__(self, index)
        return index ** 

X = indexer(  ) 
X[2]                                
for i in range(5)
    print X[i],



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Class
» Getitem