#NEWLINE# def getitem( self , index ) : #NEWLINE# #INDENT# if ( index >= len ( self . read_so_far ) ) : #NEWLINE# #INDENT# nchars = ( ( len ( self . read_so_far ) - index ) + 1 ) #NEWLINE# self . read_so_far . extend ( list ( self . w_port . read ( nchars ) ) ) #NEWLINE# #UNINDENT# ch = self . read_so_far [ index ] #NEWLINE# return index