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


Groups > comp.lang.python > #86449

Re: Python Worst Practices

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.016
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'true,': 0.05; 'subject:Python': 0.06; 'contexts': 0.09; 'false.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'camp': 0.16; 'finney': 0.16; 'nonzero': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'shell': 0.22; 'header:User- Agent:1': 0.23; 'error': 0.23; 'instance,': 0.24; 'header:X -Complaints-To:1': 0.27; 'chris': 0.29; 'unix': 0.29; 'url:wiki': 0.31; 'url:wikipedia': 0.31; 'writes:': 0.31; 'sense': 0.34; 'maybe': 0.34; 'url:org': 0.36; 'ben': 0.38; 'convention': 0.38; 'question,': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'commands': 0.60; 'success': 0.61; "you've": 0.63; 'such': 0.63; 'more': 0.64; 'url:%1': 0.72; '\xe2\x80\x93': 0.77; 'received:125': 0.84; 'subject:Practices': 0.84; 'hate': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ben Finney <ben+python@benfinney.id.au>
Subject Re: Python Worst Practices
Date Thu, 26 Feb 2015 10:48:21 +1100
References <mclca6$iie$1@ger.gmane.org> <CAPTjJmppMhBuLy=LMC=ycN0RYE9Jp8BVZbdSeqBZupd_7Nwxfw@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host jigong.madmonks.org
X-Public-Key-ID 0xAC128405
X-Public-Key-Fingerprint 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock sha1:k0QDCIcuGTJEC/eybBxGBtn0VqQ=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.19223.1424908206.18130.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1424908206 news.xs4all.nl 2841 [2001:888:2000:d::a6]:55204
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:86449

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web