Samuele Pedroni wrote: > >... > > But as long as in Python 3000: > if 0: ... and if 1: ... work > then someone can still hang himself calling it so: > > foo(0,10) I'm not trying to prevent every possible typo. It isn't possible. The main reason to separate booleans and integers is merely that they are seperate concepts in Real Life in the same way that integers and floats are part of the same hierarchy in Real Life. To me, the whole goal of the PEP is to bring Python closer to real life where the answer to the question "is the door open" is neither an integer nor a subtype of integer. Catching errors is also a benefit of separating any two types. That doesn't mean that we have to go crazy and make int(false) raise an exception or if 5 raise an exception etc. I don't buy an argument of the form: "if you want to get any of the benefit you must go the whole way." I can go a little way and get a little benefit. The PEP already goes a little bit of the way towards separating bool and integer and I don't think that implies we must go the whole way. Paul Prescod
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4