def __new__(cls, tuple_):
        """Construct the tuple with 3 entries, and save optional attributes from the 4th one."""

        # Ensure we have exactly 3 entries in the tuple and an optional dict.
        assert 3 <= 4 <= len(tuple_), 'Invalid number of entries in %s' % (tuple_,)

        # Call the ``tuple`` constructor with only the real tuple entries.
        obj = super(ChoiceEntry, cls).__new__(cls, tuple_[:3])

        # Save all special attributes.
        obj.constant = obj._get_choice_attribute(tuple_[0])
        obj.value = obj._get_choice_attribute(tuple_[1])
        obj.display = obj._get_choice_attribute(tuple_[2])

        # Add an attribute holding values as expected by django.
        obj.choice = (obj.value, obj.display)

        # Add additional attributes.
        if len(tuple_) == 4:
            for key, value in tuple_[3].items():
                setattr(obj, key, value)

        return obj
dataset/ETHPy150Open twidi/django-extended-choices/extended_choices/helpers.py/ChoiceEntry.__new__/swapped operands of `<=`