parameters: (cls, errorname)
return_statement: return newclass
docstring: Creates a class of type "errorname" which is a child of cls.default_parent or
          cls.parents[errorname] if one is defined.
  
          This __getattr__ function also stores the class permanently as an attribute of cls for
          re-use where cls is actually the class that triggered the getattr (the class that
          NESTMappedException is a metaclass of).
docstring_summary: Creates a class of type "errorname" which is a child of cls.default_parent or
          cls.parents[errorname] if one is defined.
docstring_tokens: Creates a class of type errorname which is a child of cls . default_parent or cls . parents [ errorname ] if one is defined .
function: def __getattr__(cls, errorname):
          """Creates a class of type "errorname" which is a child of cls.default_parent or
          cls.parents[errorname] if one is defined.
  
          This __getattr__ function also stores the class permanently as an attribute of cls for
          re-use where cls is actually the class that triggered the getattr (the class that
          NESTMappedException is a metaclass of). """
  
          # Dynamic class construction, first check if we know its parent
          if errorname in cls.parents:
              parent = getattr(cls, cls.parents[errorname])
          else:  # otherwise, get the default (SLIException)
              parent = cls.default_parent
  
          # and now dynamically construct the new class
          # not NESTMappedException, since that would mean the metaclass would let the new class inherit
          # this __getattr__, allowing unintended dynamic construction of attributes
          newclass = type(
              cls.__name__ + '.' + errorname,
              (parent,),
              {
                  '__init__': cls.init(parent, errorname),
                  '__doc__':
                  """Dynamically created exception {} from {}.
  
                  Created for the namespace: {}.
                  Parent exception: {}.
                  """.format(errorname, cls.source, cls.__name__, parent.__name__)
              }
          )
  
          # Cache for reuse: __getattr__ should now not get called if requested again
          setattr(cls, errorname, newclass)
  
          # And now we return the exception
          return newclass
function_tokens: def __getattr__ ( cls , errorname ) : # Dynamic class construction, first check if we know its parent if errorname in cls . parents : parent = getattr ( cls , cls . parents [ errorname ] ) else : # otherwise, get the default (SLIException) parent = cls . default_parent # and now dynamically construct the new class # not NESTMappedException, since that would mean the metaclass would let the new class inherit # this __getattr__, allowing unintended dynamic construction of attributes newclass = type ( cls . __name__ + '.' + errorname , ( parent , ) , { '__init__' : cls . init ( parent , errorname ) , '__doc__' : """Dynamically created exception {} from {}.
  
                  Created for the namespace: {}.
                  Parent exception: {}.
                  """ . format ( errorname , cls . source , cls . __name__ , parent . __name__ ) } ) # Cache for reuse: __getattr__ should now not get called if requested again setattr ( cls , errorname , newclass ) # And now we return the exception return newclass