@classmethod
def _python_value_to_header_str(cls, value):
    """
        Convert Python value to header string for __add__/__radd__.
        """
    if isinstance(value, str):
        return value
    if hasattr(value, 'items'):
        if value == {}:
            value = []
        else:
            value_list = []
            for media_range, item in value.items():
                if isinstance(item, (float, int)):
                    value_list.append((media_range, item, ''))
                else:
                    value_list.append((media_range, item[0], item[1]))
            value = sorted(value_list, key=lambda item: item[1], reverse=True)
    if isinstance(value, (tuple, list)):
        header_elements = []
        for item in value:
            if isinstance(item, (tuple, list)):
                item = cls._iterable_to_header_element(iterable=item)
            header_elements.append(item)
        header_str = ', '.join(header_elements)
    else:
        header_str = str(value)
    return header_str
