def _read_var_column(self, colnum, rows, vstorage):
if IS_PY3:<EOL><INDENT>stype = bytes<EOL><DEDENT>else:<EOL><INDENT>stype = str<EOL><DEDENT>dlist = self._FITS.read_var_column_as_list(self._ext+<NUM_LIT:1>, colnum+<NUM_LIT:1>, rows)<EOL>if vstorage == '<STR_LIT>':<EOL><INDENT>tform = self._info['<STR_LIT>'][colnum]['<STR_LIT>']<EOL>max_size = _extract_vararray_max(tform)<EOL>if max_size <= <NUM_LIT:0>:<EOL><INDENT>name = self._info['<STR_LIT>'][colnum]['<STR_LIT:name>']<EOL>mess = '<STR_LIT>'<EOL>if max_size < <NUM_LIT:0>:<EOL><INDENT>mess = "<STR_LIT>"<EOL>mess = mess % (name, tform, mess)<EOL>warnings.warn(mess, FITSRuntimeWarning)<EOL><DEDENT>else:<EOL><INDENT>mess = "<STR_LIT>"<EOL>mess = mess % (name, tform, mess)<EOL>warnings.warn(mess, FITSRuntimeWarning)<EOL><DEDENT>return self._read_var_column(colnum, rows, '<STR_LIT:object>')<EOL><DEDENT>if isinstance(dlist[<NUM_LIT:0>], stype):<EOL><INDENT>descr = '<STR_LIT>' % max_size<EOL>array = numpy.fromiter(dlist, descr)<EOL>if IS_PY3:<EOL><INDENT>array = array.astype('<STR_LIT>', copy=False)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>descr = dlist[<NUM_LIT:0>].dtype.str<EOL>array = numpy.zeros((len(dlist), max_size), dtype=descr)<EOL>for irow, item in enumerate(dlist):<EOL><INDENT>ncopy = len(item)<EOL>array[irow, <NUM_LIT:0>:ncopy] = item[:]<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>array = numpy.zeros(len(dlist), dtype='<STR_LIT:O>')<EOL>for irow, item in enumerate(dlist):<EOL><INDENT>if IS_PY3 and isinstance(item, bytes):<EOL><INDENT>item = item.decode('<STR_LIT:ascii>')<EOL><DEDENT>array[irow] = item<EOL><DEDENT><DEDENT>return array<EOL>
first read as a list of arrays, then copy into either a fixed length
array or an array of objects, depending on vstorage.