Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86449 > unrolled thread

Re: Python Worst Practices

Started byBen Finney <ben+python@benfinney.id.au>
First post2015-02-26 10:48 +1100
Last post2015-02-26 10:48 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Python Worst Practices Ben Finney <ben+python@benfinney.id.au> - 2015-02-26 10:48 +1100

#86449 — Re: Python Worst Practices

FromBen Finney <ben+python@benfinney.id.au>
Date2015-02-26 10:48 +1100
SubjectRe: Python Worst Practices
Message-ID<mailman.19223.1424908206.18130.python-list@python.org>
Chris Angelico <rosuav@gmail.com> writes:

> (Flipping the booleans makes no sense to me. When would 0 mean true
> and 1 mean false? Isn't it much more likely that, for instance, 0
> means success and nonzero means error (and maybe there's just one
> error state, so 1 means failure)?)

You've answered your question, I believe. In some contexts – such as
Unix shell – 0 ⇒ success ⇒ true, and non-0 ⇒ failure ⇒ false.

The Unix commands ‘true’ and ‘false’ follow that convention
<URL:https://en.wikipedia.org/wiki/True_and_false_%28commands%29>.

-- 
 \       “Know what I hate most? Rhetorical questions.” —Henry N. Camp |
  `\                                                                   |
_o__)                                                                  |
Ben Finney

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web