class_docstr: An AttrTree offers convenient, multi-level attribute access for
  collections of objects. AttrTree objects may also be combined
  together using the update method or merge classmethod. Here is an
  example of adding a ViewableElement to an AttrTree and accessing it:
  
  >>> t = AttrTree()
  >>> t.Example.Path = 1
  >>> t.Example.Path                             #doctest: +ELLIPSIS
  1
class_docstr_tok: ["An","AttrTree","offers","convenient",",","multi-level","attribute","access","for","collections","of","objects",".","AttrTree","objects","may","also","be","combined","together","using","the","update","method","or","merge","classmethod",".","Here","is","an","example","of","adding","a","ViewableElement","to","an","AttrTree","and","accessing","it",":",">",">",">","t","=","AttrTree","(",")",">",">",">","t.Example.Path","=","1",">",">",">","t.Example.Path","#","doctest",":","+ELLIPSIS","1"]
docstr: Access a identifier from the AttrTree or generate a new AttrTree
  with the chosen attribute path.
docstr_tok: ["Access","a","identifier","from","the","AttrTree","or","generate","a","new","AttrTree","with","the","chosen","attribute","path","."]
code: def __getattr__(self, identifier):
      """
      Access a identifier from the AttrTree or generate a new AttrTree
      with the chosen attribute path.
      """
      try:
          return super().__getattr__(identifier)
      except AttributeError:
          pass
  
      # Attributes starting with __ get name mangled
      if identifier.startswith(("_" + type(self).__name__, "__")):
          raise AttributeError(f"Attribute {identifier} not found.")
      elif self.fixed == True:
          raise AttributeError(self._fixed_error % identifier)
  
      if not any(
          identifier.startswith(prefix)
          for prefix in type(self)._disabled_prefixes
      ):
          sanitized = type(self)._sanitizer(identifier, escape=False)
      else:
          sanitized = identifier
  
      if sanitized in self.children:
          return self.__dict__[sanitized]
  
      if not sanitized.startswith("_") and util.tree_attribute(
          identifier
      ):
          self.children.append(sanitized)
          dir_mode = self.__dict__["_dir_mode"]
          child_tree = self.__class__(
              identifier=sanitized, parent=self, dir_mode=dir_mode
          )
          self.__dict__[sanitized] = child_tree
          return child_tree
      else:
          raise AttributeError(
              f"{type(self).__name__!r} object has no attribute {identifier}."
          )
  
imports: from .None import util
  from .pprint import PrettyPrinter
label_desc: Use image node_id 16 for calling the AttrTree obj's underlying member method code with example usage: obj.__getattr__(identifier) and returns: super, self, child_tree