On 5/28/2019 11:35 PM, Montana Burr wrote:
What is the justification for causing list == 3 to evaluate to False, besides the obvious "a list cannot equal a number"?
That is completely sufficient. The default comparison is by id, and a class must override to get something different. The 'default' override is compare by class and if equal, compare by value. Numbers are odd in allowing instances of different classes compare equal.
-- Terry Jan Reedy _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com