Hacker News new | past | comments | ask | show | jobs | submit login

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}



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: