Python Worst Practices

Simon Ward simon+python at bleah.co.uk
Fri Feb 27 15:23:26 EST 2015



On 27 February 2015 20:06:25 GMT+00:00, I wrote:

>I mentioned the true and false. OK, so it's a meme, but it's based on a
>false (pun intended) understanding of exit status codes. That success
>evaluates to true and failure evaluates to false does not mean the
>values of truth and falseness are inverted. No programming language
>other than that provided by system shells I have used evaluates 0 to
>true.

I hope the following examples from bash illustrate this:

$ (( 0 )) && echo success
$ (( 1 )) && echo success
success
$ (( 0 )) ; echo $?
1
$ (( 1 )) ; echo $?
0

Simon



More information about the Python-list mailing list