Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'true,': 0.05; 'subject:Python': 0.06; 'deny': 0.07; '*is*': 0.09; 'acceptance': 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; 'finney': 0.16; 'processes.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; '\xe2\x80\x9cprogram': 0.16; 'wrote:': 0.18; 'machine': 0.22; 'programming': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'right.': 0.26; 'values': 0.27; 'header:X-Complaints-To:1': 0.27; 'testing': 0.29; "i'm": 0.30; 'too.': 0.31; 'writes:': 0.31; 'community': 0.33; 'running': 0.33; 'but': 0.35; 'ben': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'commands': 0.60; 'tell': 0.60; 'effective': 0.61; 'success': 0.61; 'show': 0.63; '2015': 0.84; 'borrow': 0.84; 'received:125': 0.84; 'subject:Practices': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Python Worst Practices Date: Fri, 27 Feb 2015 08:23:34 +1100 References: <85bnkh5z96.fsf@benfinney.id.au> <85zj814jmb.fsf@benfinney.id.au> <1103e6a0-2183-4641-bf98-2927806c2172@email.android.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 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:MYRFM6BfmKTWEdTQKZh8mIhQqbk= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424985803 news.xs4all.nl 2879 [2001:888:2000:d::a6]:47517 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:86548 Simon Ward writes: > On 26 February 2015 00:11:24 GMT+00:00, Ben Finney wrote: > >You'd better borrow the time machine and tell the creators of Unix. The > >meme is already established for decades now. > > 0 = success and non-zero = failure is the meme established, rather > than 0 = true, non-zero = false. That is not the case: the commands ‘true’ (returns value 0) and ‘false’ (returns value 1) are long established in Unix. So that *is* part of the meme I'm describing. > None of the above is a good reason to use error *or* success return > values in Python--use exceptions!--but may be encountered when running > other processes. Right. But likewise, don't deny that “true == 0” and “false == non-zero” has a wide acceptance in the programming community too. -- \ “Program testing can be a very effective way to show the | `\ presence of bugs, but is hopelessly inadequate for showing | _o__) their absence.” —Edsger W. Dijkstra | Ben Finney