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


Groups > comp.lang.python > #86453

Re: Python Worst Practices

From Ben Finney <ben+python@benfinney.id.au>
Subject Re: Python Worst Practices
Date 2015-02-26 11:11 +1100
References <mclca6$iie$1@ger.gmane.org> <CAPTjJmppMhBuLy=LMC=ycN0RYE9Jp8BVZbdSeqBZupd_7Nwxfw@mail.gmail.com> <85bnkh5z96.fsf@benfinney.id.au> <CAPTjJmrySN-tpcyXON4v_Ux0E961DYZqc5kF116sTLp_-RetqQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.19225.1424909709.18130.python-list@python.org> (permalink)

Show all headers | View raw


Chris Angelico <rosuav@gmail.com> writes:

> On Thu, Feb 26, 2015 at 10:48 AM, Ben Finney <ben+python@benfinney.id.au> wrote:
> > Chris Angelico <rosuav@gmail.com> writes:
> >
> >> (Flipping the booleans makes no sense to me. When would 0 mean true
> >> and 1 mean false? […])
> >
> > The Unix commands ‘true’ and ‘false’ follow that convention
> > <URL:https://en.wikipedia.org/wiki/True_and_false_%28commands%29>.
>
> Yes, but my point is: You shouldn't need to rebind those names (or
> have names "true" and "false" for 0 and 1).

That's not what you asked, though. You asked “When would 0 mean true and
1 mean false?” My answer: in all Unix shell contexts.

> Instead, use "success" and "failure".

You'd better borrow the time machine and tell the creators of Unix. The
meme is already established for decades now.

-- 
 \       “Firmness in decision is often merely a form of stupidity. It |
  `\        indicates an inability to think the same thing out twice.” |
_o__)                                                —Henry L. Mencken |
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 11:11 +1100

csiph-web