Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Operator Precedence/Boolean Logic Date: Sat, 16 Jul 2016 20:46:14 +1000 Lines: 26 Message-ID: References: <15997174-44d5-431c-8f90-a8d700921820@googlegroups.com> <3a840cef-24d2-4abb-8e5b-dc80bf48944d@googlegroups.com> <63fe7ea9-a14f-94a2-cdd5-27aa902fbf6b@online.de> <576b8a41$0$2792$c3e8da3$76491128@news.astraweb.com> <576B9B33.2030903@rece.vub.ac.be> <07e13a5d-38bf-7bfa-f45f-a24dea8e3004@online.de> <576ba927$0$1504$c3e8da3$5496439d@news.astraweb.com> <87wplgfdb5.fsf@elektro.pacujo.net> <4c257ef7-519f-4121-b63b-fb38566072d0@googlegroups.com> <5773c832$0$1598$c3e8da3$5496439d@news.astraweb.com> <57745c6d$0$1583$c3e8da3$5496439d@news.astraweb.com> <5775555f$0$22140$c3e8da3$5496439d@news.astraweb.com> <7ecde6d0-d3db-4a7a-8de6-65b398fedafe@googlegroups.com> <578a0992$0$1610$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de yaqupcrfKzSF8A6OUb89iAUZ7w9LEawC/r/34h5UqU3A== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '16,': 0.03; 'api': 0.09; 'cc:addr:python-list': 0.09; 'differing': 0.09; 'anyway': 0.11; 'do,': 0.15; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'tripped': 0.16; 'wrote:': 0.16; "shouldn't": 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'decide': 0.23; 'demonstrate': 0.23; 'sat,': 0.23; "haven't": 0.24; 'header:In-Reply-To:1': 0.24; '(which': 0.26; 'chris': 0.26; 'equivalent': 0.27; 'not.': 0.27; 'room': 0.27; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; 'objects': 0.29; "i'm": 0.30; 'subject:/': 0.30; 'anyone': 0.32; "can't": 0.32; 'getting': 0.33; 'class': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'definition': 0.34; 'received:google.com': 0.35; "isn't": 0.35; 'but': 0.36; 'too': 0.36; 'there': 0.36; 'possible': 0.36; '(and': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'say': 0.37; 'wrong': 0.38; 'default': 0.61; 'design,': 0.61; 'matter': 0.63; 'capable': 0.65; 'believe': 0.66; "they're": 0.66; 'jul': 0.72; 'counts': 0.81; 'chrisa': 0.84; 'demonstrates': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc :content-transfer-encoding; bh=AVcFvnJzSs8/61iq8R/3f/VTVgmcjyiehusBKL7Eqes=; b=jVIJr+15v6pLTzTJewaRj6m7qG+0RisAeoxguxgRRZcdTVNT6ZDBjTx8aFIBFagLrD RTqLs8Udsv9go9ZFniuLS9zQrod0UlLnoxCCcT0hgrY9ez52RqDlhJ2p6BCP+fzP0Hcx 3q9QlrorQgpGYQuhY/TAVTOpOpMDmCaHzAWRIoIUVYrr80rUy7OZ0qe6xx+iVBEq1d1g xPzSb9oZQMHxJYcw7v3H/RO1KJbzsYydp6KkfkdrkNf574EGC07tHF6DKAR3RK6lY0sd DSPKevrEkPiNazI96FwI9zyWIo7/diF1fSy6inWkoKbqlYiF5oWl2HDlaEpPxzneyjXo vYbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc:content-transfer-encoding; bh=AVcFvnJzSs8/61iq8R/3f/VTVgmcjyiehusBKL7Eqes=; b=L+6AiYi/QYD/5Dk9AqlwNFSGVw9+0NhHj7Mko7jhGoMDJGSRH0C3rBNOg2ZzJ+JovF 5I7+MmK0NLoMsb/9FZcNrF3Y5qz2sDipjkl6mlh0aJs5/aPrnh9gWT25oN+YX0mOynq5 0PmRvNn6s4oK2HstWKVhTRH6T2mb4RWTeaArPPeVJ6vFRW80k7fF41DB5lEoFdbp3hdi qvTvHKWqrRzrkp2ZvKwqXF87RbMvTtvYnm1hWtyK0AJEF0AR+DPnSK/sXAXbKUXHECfK s9wILGnxJinOxqa1IPiScc840Vw5E7HEpPcq4cKUgykuegZMTH0BsJkgV0U6ZnlK4BOc gOEw== X-Gm-Message-State: ALyK8tKl4DlFnmOpYg2O3Y34aCH3DNBggIaGXSAPKIThnrumLQ/Q6iqJWdrw0T/gXigHLbEUIvZlulazq4Mbkg== X-Received: by 10.194.173.41 with SMTP id bh9mr4899468wjc.47.1468665975773; Sat, 16 Jul 2016 03:46:15 -0700 (PDT) In-Reply-To: <578a0992$0$1610$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <15997174-44d5-431c-8f90-a8d700921820@googlegroups.com> <3a840cef-24d2-4abb-8e5b-dc80bf48944d@googlegroups.com> <63fe7ea9-a14f-94a2-cdd5-27aa902fbf6b@online.de> <576b8a41$0$2792$c3e8da3$76491128@news.astraweb.com> <576B9B33.2030903@rece.vub.ac.be> <07e13a5d-38bf-7bfa-f45f-a24dea8e3004@online.de> <576ba927$0$1504$c3e8da3$5496439d@news.astraweb.com> <87wplgfdb5.fsf@elektro.pacujo.net> <4c257ef7-519f-4121-b63b-fb38566072d0@googlegroups.com> <5773c832$0$1598$c3e8da3$5496439d@news.astraweb.com> <57745c6d$0$1583$c3e8da3$5496439d@news.astraweb.com> <5775555f$0$22140$c3e8da3$5496439d@news.astraweb.com> <7ecde6d0-d3db-4a7a-8de6-65b398fedafe@googlegroups.com> <578a0992$0$1610$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:111509 On Sat, Jul 16, 2016 at 8:16 PM, Steven D'Aprano wrot= e: >> If both you and Chris tripped up on a right definition of an =E2=80=9Cem= pty=E2=80=9D >> automaton and regex respectively, I believe it demonstrates that getting >> boolishness for an arbitrary type right is at least non-trivial. [FWIW M= y >> belief: In general its nonsensical] > > Firstly, I disagree that I tripped up on anything. You haven't given any > reason to think that Automata objects shouldn't be truthy, and even if yo= u > do, isn't that just a matter of opinion? I also disagree that I "tripped up", but there is room for differing decisions in API design, and this is one of them. I can't say perfectly, from my armchair (which I'm not in anyway - way too cumbersome for a desktop computer), which objects are capable of being "empty" and which are not. The implementer of the automaton class or the regex class has to decide what counts as "empty". As Steven says, the default is that they're all truthy, and onus is on the implementer to demonstrate that this object is functionally equivalent to 0 or an empty collection. (And it's possible for ANYONE to get that wrong - cf timedelta.) ChrisA