3 ms·
It's not really a bool/int subclass issue but one of hash() and equality. >>> {1} | {1.0} {1} >>> {1.0} | {1} {1.0} >>> import fractions
by eesmith 6y ago
It's not really a bool/int subclass issue but one of hash() and equality.
>>> {1} | {1.0}
{1}
>>> {1.0} | {1}
{1.0}
>>> import fractions
>>> x = fractions.Fraction(1)
>>> {x} | {1}
{Fraction(1, 1)}
>>> {1} | {x}
{1}