Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'guido': 0.05; 'pep': 0.09; 'preservation': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:test': 0.09; 'python': 0.11; 'jan': 0.12; 'backward': 0.16; 'backwards': 0.16; 'finney': 0.16; 'iterator,': 0.16; 'preserving': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'reviewers': 0.16; 'unneeded': 0.16; 'url:peps': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'all,': 0.19; 'machine': 0.22; '>>>': 0.22; 'example': 0.22; '(in': 0.22; 'creating': 0.23; 'header:User- Agent:1': 0.23; 'url:dev': 0.24; 'fine': 0.24; 'developers': 0.25; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'fixed': 0.29; 'am,': 0.29; "doesn't": 0.30; "d'aprano": 0.31; 'equality': 0.31; 'operations.': 0.31; 'steven': 0.31; 'writes:': 0.31; 'up.': 0.33; 'url:python': 0.33; 'core': 0.34; 'agree': 0.35; 'operations': 0.35; 'but': 0.35; 'there': 0.35; 'url:org': 0.36; 'should': 0.36; 'thank': 0.38; 'ben': 0.38; 'filter': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'eventually': 0.60; 'most': 0.60; 'no.': 0.61; 'more': 0.64; 'subject': 0.69; 'safe': 0.72; 'future,': 0.83; 'received:fios.verizon.net': 0.84; 'subject::': 0.85; 'numerous': 0.93; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: (test) ? a:b Date: Sun, 26 Oct 2014 17:12:46 -0400 References: <54476af8$0$21651$426a74cc@news.free.fr> <7839376e-fc27-4299-ae63-4ddf17ef9a8a@googlegroups.com> <7d2ea3c1-504e-4f5c-8338-501b1483df38@googlegroups.com> <878uk6x5nd.fsf@elektro.pacujo.net> <544a1016$0$13000$c3e8da3$5496439d@news.astraweb.com> <544b2f15$0$12978$c3e8da3$5496439d@news.astraweb.com> <544c3bde$0$12988$c3e8da3$5496439d@news.astraweb.com> <544c754b$0$12991$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Gmane-NNTP-Posting-Host: pool-108-16-203-145.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <544c754b$0$12991$c3e8da3$5496439d@news.astraweb.com> 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: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414357988 news.xs4all.nl 2893 [2001:888:2000:d::a6]:35333 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79728 On 10/26/2014 12:15 AM, Steven D'Aprano wrote: > Ben Finney wrote: > >> Steven D'Aprano writes: >> >>> I suspect that Guido and the core developers disagree with you, since= >>> they had the opportunity to fix that in Python 3 and didn't. >> >> That doesn't follow; there are numerous warts in Python 2 that were no= t >> fixed in Python 3. As I understand it, the preservation of bool=E2=80=93= int >> equality has more to do with preserving backward compatibility. > > On reviewing PEP 285, I think it is safe to say that Guido *explicitly*= > wants bools to be ints, not just for backwards compatibility: > > 4) Should we strive to eliminate non-Boolean operations on bools > in the future, through suitable warnings, so that for example > True+1 would eventually (in Python 3000) be illegal? > > =3D> No. > > There's a small but vocal minority that would prefer to see > "textbook" bools that don't support arithmetic operations at > all, but most reviewers agree with me that bools should always > allow arithmetic operations. > > http://legacy.python.org/dev/peps/pep-0285/ Thank you for digging this up. I was one of the 'most reviewers'. Even though filter now returns an iterator, so that one can write sum(1 for _ in filter(None, iterable_of_bools)) without creating an unneeded itermediate list, I still prefer sum(iterable_of_bools) for efficiency not only for the machine but also for me writing and readi= ng. [snip of fine disquisition on the subject to which I have nothing to add]= --=20 Terry Jan Reedy