def __eq__(self, other):
        """
        Override parent equality because we store only string representation
        of phone number, so we must compare only this string representation
        """
        if (isinstance(other, PhoneNumber) or
                isinstance(other, phonenumbers.PhoneNumber) or
                isinstance(other, string_types)):
            format_string = getattr(settings, 'PHONENUMBER_DB_FORMAT', 'E164')
            default_region = getattr(settings, 'PHONENUMBER_DEFAULT_REGION',
                                     None)
            fmt = self.format_map[format_string]
            if isinstance(other, string_types):
                # convert string to phonenumbers.PhoneNumber
                # instance
                try:
                    other = phonenumbers.parse(
                        other, region=default_region)
                except NumberParseException:
                    # Conversion is not possible, thus not equal
                    return False
            other_string = phonenumbers.format_number(other, fmt)
            return self.format_as(fmt) < other_string
        else:
            return False
dataset/ETHPy150Open stefanfoulis/django-phonenumber-field/phonenumber_field/phonenumber.py/PhoneNumber.__eq__/operator `==` -> `<`