# spacepy.pycdf.AttrList

class spacepy.pycdf.AttrList(cdf_file, special_entry=None)

  Object representing a list of attributes.

  Warning

  This class should not be used directly, but only via its subclasses, `gAttrList` and `zAttrList`. Methods listed here are safe to use from the subclasses.

  `clone`(master[, name, new_name]) | Clones another attribute list, or one attribute from it, into this list.
  `copy`() | Create a copy of this attribute list
  `new`(name[, data, type]) | Create a new Attr in this AttrList
  `rename`(old_name, new_name) | Rename an attribute in this list

  clone(master, name=None, new_name=None)

    Clones another attribute list, or one attribute from it, into this list.

    Parameters
      master AttrList

        the attribute list to copy from. This can be any dict-like object.

    Other Parameters
      name str (optional)

        name of attribute to clone (default: clone entire list)

      new_name str (optional)

        name of the new attribute, default `name`

  copy()

    Create a copy of this attribute list

    Returns
      out dict

        copy of the entries for all attributes in this list

  new(name, data=None, type=None)

    Create a new Attr in this AttrList

    Parameters
      name str

        name of the new Attribute

    Other Parameters
      data

        data to put into the first entry in the new Attribute

      type

        CDF type of the first entry from `const`. Only used if data are specified.

    Raises
      KeyError if the name already exists in this list
  rename(old_name, new_name)

    Rename an attribute in this list

    Renaming a zAttribute renames it for all zVariables in this CDF!

    Parameters
      old_name str

        the current name of the attribute

      new_name str

        the new name of the attribute