def rename(self, new_name):
    '\n        Renames this variable\n\n        Parameters\n        ==========\n        new_name : str\n            the new name for this variable\n        '
    try:
        enc_name = new_name.encode('ascii')
    except AttributeError:
        enc_name = new_name
    if (len(enc_name) > const.CDF_VAR_NAME_LEN256):
        raise CDFError(const.BAD_VAR_NAME)
    self._call(const.PUT_, const.zVAR_NAME_, enc_name)
    self.cdf_file.add_to_cache(enc_name, self.cdf_file.var_num(self._name))
    del self.cdf_file._var_nums[self._name]
    self._name = enc_name
Renames this variable

Parameters
==========
new_name : str
    the new name for this variable
def rename(self, new_name):
    '\n        Renames this variable\n\n        Parameters\n        ==========\n        new_name : str\n            the new name for this variable\n        '
    try:
        enc_name = new_name.encode('ascii')
    except AttributeError:
        enc_name = new_name
    if (len(enc_name) > const.CDF_VAR_NAME_LEN256):
        raise CDFError(const.BAD_VAR_NAME)
    self._call(const.PUT_, const.zVAR_NAME_, enc_name)
    self.cdf_file.add_to_cache(enc_name, self.cdf_file.var_num(self._name))
    del self.cdf_file._var_nums[self._name]
    self._name = enc_name