def __init__(self, cdf_file, attr_name, create=False):
    'Initialize this attribute\n\n        @param cdf_file: CDF file containing this attribute\n        @type cdf_file: :py:class:`pycdf.CDF`\n        @param attr_name: Name of this attribute\n        @type attr_name: str\n        @param create: True to create attribute, False to look up existing.\n        @type create: bool\n        '
    self._cdf_file = cdf_file
    self._raw = False
    if isinstance(attr_name, str_classes):
        try:
            self._name = attr_name.encode('ascii')
        except AttributeError:
            self._name = attr_name
        attrno = ctypes.c_long()
        if create:
            self._cdf_file._call(const.CREATE_, const.ATTR_, self._name, self.SCOPE, ctypes.byref(attrno))
            self._cdf_file.add_attr_to_cache(self._name, attrno.value, (self.SCOPE == const.GLOBAL_SCOPE))
        else:
            (attrno, scope) = self._cdf_file.attr_num(self._name)
    else:
        name = ctypes.create_string_buffer((const.CDF_ATTR_NAME_LEN256 + 1))
        scope = ctypes.c_long(0)
        self._cdf_file._call(const.SELECT_, const.ATTR_, ctypes.c_long(attr_name))
        self._cdf_file._call(const.GET_, const.ATTR_NAME_, name, const.GET_, const.ATTR_SCOPE_, ctypes.byref(scope))
        self._name = name.value.rstrip()
        if (scope.value == const.GLOBAL_SCOPE.value):
            scope = True
        elif (scope.value == const.VARIABLE_SCOPE.value):
            scope = False
        else:
            raise CDFError(const.BAD_SCOPE)
        self._cdf_file.add_attr_to_cache(self._name, attr_name, scope)
Initialize this attribute

@param cdf_file: CDF file containing this attribute
@type cdf_file: :py:class:`pycdf.CDF`
@param attr_name: Name of this attribute
@type attr_name: str
@param create: True to create attribute, False to look up existing.
@type create: bool
def __init__(self, cdf_file, attr_name, create=False):
    'Initialize this attribute\n\n        @param cdf_file: CDF file containing this attribute\n        @type cdf_file: :py:class:`pycdf.CDF`\n        @param attr_name: Name of this attribute\n        @type attr_name: str\n        @param create: True to create attribute, False to look up existing.\n        @type create: bool\n        '
    self._cdf_file = cdf_file
    self._raw = False
    if isinstance(attr_name, str_classes):
        try:
            self._name = attr_name.encode('ascii')
        except AttributeError:
            self._name = attr_name
        attrno = ctypes.c_long()
        if create:
            self._cdf_file._call(const.CREATE_, const.ATTR_, self._name, self.SCOPE, ctypes.byref(attrno))
            self._cdf_file.add_attr_to_cache(self._name, attrno.value, (self.SCOPE == const.GLOBAL_SCOPE))
        else:
            (attrno, scope) = self._cdf_file.attr_num(self._name)
    else:
        name = ctypes.create_string_buffer((const.CDF_ATTR_NAME_LEN256 + 1))
        scope = ctypes.c_long(0)
        self._cdf_file._call(const.SELECT_, const.ATTR_, ctypes.c_long(attr_name))
        self._cdf_file._call(const.GET_, const.ATTR_NAME_, name, const.GET_, const.ATTR_SCOPE_, ctypes.byref(scope))
        self._name = name.value.rstrip()
        if (scope.value == const.GLOBAL_SCOPE.value):
            scope = True
        elif (scope.value == const.VARIABLE_SCOPE.value):
            scope = False
        else:
            raise CDFError(const.BAD_SCOPE)
        self._cdf_file.add_attr_to_cache(self._name, attr_name, scope)