(meta, bases)
return winner
Calculate the most derived metaclass.
Calculate the most derived metaclass.
Calculate the most derived metaclass .
def _calculate_meta(meta, bases):
    """Calculate the most derived metaclass."""
    winner = meta
    for base in bases:
        base_meta = type(base)
        if issubclass(winner, base_meta):
            continue
        if issubclass(base_meta, winner):
            winner = base_meta
            continue
        # else:
        raise TypeError("metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases")
    return winner
def _calculate_meta ( meta , bases ) : winner = meta for base in bases : base_meta = type ( base ) if issubclass ( winner , base_meta ) : continue if issubclass ( base_meta , winner ) : winner = base_meta continue # else: raise TypeError ( "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases" ) return winner