parameters: (cls, new_cls)
return_statement: return inherited_loggables
docstring: Get loggable quantities from new class's __mro__.
docstring_summary: Get loggable quantities from new class's __mro__.
docstring_tokens: Get loggable quantities from new class s __mro__ .
function: def _get_inherited_loggables(cls, new_cls):
          """Get loggable quantities from new class's __mro__."""
          # We reverse the mro list to ensure that if a conflict in names exist we
          # take the one with the most priority in the mro. Also track if any
          # parent classes also have Loggable as a metaclass. This allows us to
          # know if we should error if a loggables method is defined. We also
          # skip the first entry since that is the new_cls itself.
          inherited_loggables = dict()
          for base_cls in reversed(new_cls.__mro__[1:]):
              # The conditional checks if the type of one of the parent classes of
              # new_cls has a metaclass (or type) which is a subclass of Loggable
              # or one of its subclasses.
              if issubclass(type(base_cls), Loggable):
                  inherited_loggables.update({
                      name: deepcopy(quantity).update_cls(new_cls)
                      for name, quantity in base_cls._export_dict.items()
                  })
          return inherited_loggables
function_tokens: def _get_inherited_loggables ( cls , new_cls ) : # We reverse the mro list to ensure that if a conflict in names exist we # take the one with the most priority in the mro. Also track if any # parent classes also have Loggable as a metaclass. This allows us to # know if we should error if a loggables method is defined. We also # skip the first entry since that is the new_cls itself. inherited_loggables = dict ( ) for base_cls in reversed ( new_cls . __mro__ [ 1 : ] ) : # The conditional checks if the type of one of the parent classes of # new_cls has a metaclass (or type) which is a subclass of Loggable # or one of its subclasses. if issubclass ( type ( base_cls ) , Loggable ) : inherited_loggables . update ( { name : deepcopy ( quantity ) . update_cls ( new_cls ) for name , quantity in base_cls . _export_dict . items ( ) } ) return inherited_loggables