def __init__(self, zvar, key):
    'Create a Hyperslice\n\n        @param zvar: zVariable that this slices\n        @type zvar: :py:class:`pycdf.Var`\n        @param key: Python multi-dimensional slice as passed to\n                    __getitem__\n        @type key: tuple of slice and/or int\n        @raise IndexError: if slice is out of range, mismatches dimensions, or\n                           otherwise unparsable.\n        @raise ValueError: if slice has invalid values\n        '
    self.zvar = zvar
    self.rv = self.zvar.rv()
    self.dims = (zvar._n_dims() + 1)
    self.dimsizes = ([len(zvar)] + zvar._dim_sizes())
    self.starts = ([0] * self.dims)
    self.counts = numpy.empty((self.dims,), dtype=numpy.int32)
    self.counts.fill(1)
    self.intervals = ([1] * self.dims)
    self.degen = numpy.zeros(self.dims, dtype=numpy.bool)
    self.rev = numpy.zeros(self.dims, dtype=numpy.bool)
    if (not hasattr(key, '__len__')):
        key = (key,)
    if (not self.rv):
        key = ((0,) + key)
    key = self.expand_ellipsis(key, self.dims)
    if self.rv:
        if (len(key) == 1):
            key = self.expand_ellipsis((key + (Ellipsis,)), self.dims)
        elif (len(key) == (self.dims - 1)):
            key = ((slice(None, None, None),) + key)
    if (len(key) == self.dims):
        self.expanded_key = key
        for i in range(self.dims):
            idx = key[i]
            if hasattr(idx, 'start'):
                (self.starts[i], self.counts[i], self.intervals[i], self.rev[i]) = self.convert_range(idx.start, idx.stop, idx.step, self.dimsizes[i])
            else:
                if (idx < 0):
                    idx += self.dimsizes[i]
                if ((idx != 0) and ((idx >= self.dimsizes[i]) or (idx < 0))):
                    raise IndexError('list index out of range')
                self.starts[i] = idx
                self.degen[i] = True
    else:
        raise IndexError(('Slice does not match dimensions for zVar ' + str(zvar._name)))
    self.column = zvar.cdf_file.col_major()
Create a Hyperslice

@param zvar: zVariable that this slices
@type zvar: :py:class:`pycdf.Var`
@param key: Python multi-dimensional slice as passed to
            __getitem__
@type key: tuple of slice and/or int
@raise IndexError: if slice is out of range, mismatches dimensions, or
                   otherwise unparsable.
@raise ValueError: if slice has invalid values
def __init__(self, zvar, key):
    'Create a Hyperslice\n\n        @param zvar: zVariable that this slices\n        @type zvar: :py:class:`pycdf.Var`\n        @param key: Python multi-dimensional slice as passed to\n                    __getitem__\n        @type key: tuple of slice and/or int\n        @raise IndexError: if slice is out of range, mismatches dimensions, or\n                           otherwise unparsable.\n        @raise ValueError: if slice has invalid values\n        '
    self.zvar = zvar
    self.rv = self.zvar.rv()
    self.dims = (zvar._n_dims() + 1)
    self.dimsizes = ([len(zvar)] + zvar._dim_sizes())
    self.starts = ([0] * self.dims)
    self.counts = numpy.empty((self.dims,), dtype=numpy.int32)
    self.counts.fill(1)
    self.intervals = ([1] * self.dims)
    self.degen = numpy.zeros(self.dims, dtype=numpy.bool)
    self.rev = numpy.zeros(self.dims, dtype=numpy.bool)
    if (not hasattr(key, '__len__')):
        key = (key,)
    if (not self.rv):
        key = ((0,) + key)
    key = self.expand_ellipsis(key, self.dims)
    if self.rv:
        if (len(key) == 1):
            key = self.expand_ellipsis((key + (Ellipsis,)), self.dims)
        elif (len(key) == (self.dims - 1)):
            key = ((slice(None, None, None),) + key)
    if (len(key) == self.dims):
        self.expanded_key = key
        for i in range(self.dims):
            idx = key[i]
            if hasattr(idx, 'start'):
                (self.starts[i], self.counts[i], self.intervals[i], self.rev[i]) = self.convert_range(idx.start, idx.stop, idx.step, self.dimsizes[i])
            else:
                if (idx < 0):
                    idx += self.dimsizes[i]
                if ((idx != 0) and ((idx >= self.dimsizes[i]) or (idx < 0))):
                    raise IndexError('list index out of range')
                self.starts[i] = idx
                self.degen[i] = True
    else:
        raise IndexError(('Slice does not match dimensions for zVar ' + str(zvar._name)))
    self.column = zvar.cdf_file.col_major()