On 3/23/2016 4:51 AM, Peter Otten wrote:
The pythonic solution is "don't do this". The == operator cannot discriminate between 0, 0.0, and False,
and 0j and Fraction(0, 1) and Decimal(0)
or 1, 1.0, and True
and 1+0j, Fraction(1, 1) and Decimal(1) Sets and dicts are based both based on (transitive) equality. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list