def read_chunks(file, size=io.DEFAULT_BUFFER_SIZE):
 while True:
  chunk = file.read(size)
  if (not chunk):
   break
  (yield chunk)

def read_chunks ( file , size = io . DEFAULT_BUFFER_SIZE ) : while True : chunk = file . read ( size ) if ( not chunk ) : break ( yield chunk )
yield pieces of data from a file-like object until eof .