'list variables from stream'

def list_variables(self):

    self.mat_stream.seek(0)
    self.initialize_read()
    vars = []
    while (not self.end_of_stream()):
        (hdr, next_position) = self.read_var_header()
        name = asstr(hdr.name)
        shape = self._matrix_reader.shape_from_header(hdr)
        info = mclass_info.get(hdr.mclass, 'unknown')
        vars.append((name, shape, info))
        self.mat_stream.seek(next_position)
    return vars
