In [32]: object() > 0
Out[32]: True
In fact, it’s greater than any integer I’ve tried.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because Python 2.x tried to make available comparison between objects of different types (even if they do not make sense).
It was fixed on Python 3:
The order used in Python 2.x:
Numbers are:
int,boolandfloatbut notcomplexbecause they can’t be comparedAlso, objects from old style classes (named
instanceobjects) stay betweenNoneandNumbersfor some odd reason.