#NEWLINE# def __getitem__( self , index ) : #NEWLINE# #INDENT# cls = type ( self ) #NEWLINE# if isinstance ( index , slice ) : #NEWLINE# #INDENT# return cls ( self . _components [ index ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( index , numbers . Integral ) : #NEWLINE# #INDENT# return self . _components [ msg ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# msg = '{.__name__} indices must be integers' #NEWLINE# raise TypeError ( msg . format ( cls ) )