Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is for backward-compatibility reasons. The comparison operators in Python produced 1 or 0 before boolean was a thing, and programs existed that exploited this, i.e. you can do something like `(a < b) - (a > b)` in a sorting algorithm. Same thing in C, or even more so, as the comparison operators produce an `int` instead of a `bool`.


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

Search: