Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Clean Singleton Docstrings Date: Sat, 16 Jul 2016 16:29:18 +1000 Lines: 39 Message-ID: References: <7046c74e-e5ea-4dde-8847-8c556756a563@googlegroups.com> <5789B601.9000604@stoneleaf.us> <9d2a0934-bf26-42a8-9bb2-e4e75b2d2ad3@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de 5HqC9l/9YIxpUfhtVZWcLAZvzJIBQDbYfhuLDkIh+Jpw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'operator': 0.03; 'none,': 0.05; 'run-time': 0.05; 'assignment': 0.07; 'bug.': 0.07; 'false,': 0.07; 'problem?': 0.07; 'cc:addr:python-list': 0.09; 'augmented': 0.09; 'bool': 0.09; 'it;': 0.09; 'precedence': 0.09; 'tuple': 0.09; 'python': 0.10; 'exception': 0.13; '2016': 0.16; 'assignment.': 0.16; 'boolean': 0.16; 'bugs,': 0.16; 'bugs.': 0.16; 'elsewhere,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'operator).': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Singleton': 0.16; 'ternary': 0.16; 'wrote:': 0.16; '(in': 0.18; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'lawrence': 0.22; "python's": 0.23; 'sat,': 0.23; 'header:In-Reply-To:1': 0.24; 'bugs': 0.27; 'handling': 0.27; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'operators': 0.29; 'there.': 0.30; 'too.': 0.30; 'error.': 0.31; 'especially': 0.32; 'language.': 0.32; 'statement': 0.32; 'problem': 0.33; 'lets': 0.33; 'case,': 0.34; 'gets': 0.35; 'received:google.com': 0.35; 'false': 0.35; "isn't": 0.35; 'should': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'difference': 0.38; 'where': 0.40; 'is.': 0.63; 'policy': 0.63; 'saturday,': 0.63; 'between': 0.65; 'respect': 0.65; 'better.': 0.66; 'jul': 0.72; '\xe2\x80\x93': 0.72; 'led': 0.72; '*lot*': 0.84; 'chrisa': 0.84; 'confusing': 0.84; 'etc,': 0.84; 'rexx,': 0.84; 'to:none': 0.91; 'canonical': 0.91; 'ethan': 0.91; 'furman': 0.91; 'notion': 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=2ObYf0x1KhZxZkydHLwa7QLDICIQ6yQYngA9WBR3a/4=; b=bqECS/x00TNtQOlAFpZMlv0X4GWgxD/yY5dKvQbT2csgq6cRVtjpkkm2JANt+2ct4D 7PAoLkoPlP2St0z6PT6uVV+kR3HFMaCLtyZIqSHf07XO2YGmlhfalQsF28Ngp+aZUj4t 5vM6PDOOgrOmBv2VCCUVilNWfAYNI9pdYaBoyO339y72vdEJP9CUrVT9x0nSKAQ9M5UB hzelibxxqtVvYk6H+vUBt/qa56FOqMf0xOoHWdsTNsnNxKs5lLzNjNME8/vsnqZvQwZ+ wcSp1gRRNl+RTQuBYHlaRXQoNPw7gk4aqofHyG+Kc8FCO26xjZX58DtVNHFTA8V4CMi3 iBkA== 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=2ObYf0x1KhZxZkydHLwa7QLDICIQ6yQYngA9WBR3a/4=; b=Brdv5c8fpbD2mqjrjZy7y6q32RLpTJNEI3V0FYopby5zY/9lblkXqu2stZFYxKiEZt iTN1Pn+ofICG3UI9FF8LUj30ME0StFaFcz3z2kF6sTPAb2gAIX3/RJznvCBhNS2EP8mL IOZYfDdY+Q+lDGghOKtoXZRt9/PihiJEsoOHguW9VyE00oTYvczwwRbniq7zxikxFXJv +UPvOarqGjgMN7BHrtAXJaG64hfnvtsv4RCspYaDnhkKZZaN57DTPm2gRdQMTEM8kLbn BLWAb7QHBee0Sygsf3gONiwhRkoRGnwyI9VzU81xrqSb7Wqm4XtYqMZ3weVK1Qd+VdJo VMzA== X-Gm-Message-State: ALyK8tL0CbUoPnLhT8JaElikdsOLISWfRRoh378hBa6EjUIpCsRoob9WwXeo7TbiTZVNSNOi1ADoTUxntTu2dw== X-Received: by 10.28.50.199 with SMTP id y190mr37867757wmy.61.1468650559253; Fri, 15 Jul 2016 23:29:19 -0700 (PDT) In-Reply-To: <9d2a0934-bf26-42a8-9bb2-e4e75b2d2ad3@googlegroups.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: <7046c74e-e5ea-4dde-8847-8c556756a563@googlegroups.com> <5789B601.9000604@stoneleaf.us> <9d2a0934-bf26-42a8-9bb2-e4e75b2d2ad3@googlegroups.com> Xref: csiph.com comp.lang.python:111496 On Sat, Jul 16, 2016 at 4:19 PM, Lawrence D=E2=80=99Oliveiro wrote: > On Saturday, July 16, 2016 at 4:20:13 PM UTC+12, Ethan Furman wrote: >> >> On 07/15/2016 09:04 PM, Rustom Mody wrote: >> >>> Just that suggesting that python's bool notion is straightforward is an >>> unnecessary lie =E2=80=93 especially to newbies. >> >> Python's boolean concept is as simple as it gets -- what is not >> straightforward about it? > > The fact that it led to the aforementioned bug. The difference between ints and floats can lead to bugs, too. Which one should we eliminate? Tuple augmented assignment can lead to extremely confusing bugs. Let's abolish augmented assignment. Or tuples? Operator precedence leads to bugs when people don't respect it. Eliminate it; all operators function at the same precedence, with middle-to-outside associativity (as popularized by the "if/else" ternary operator). There. Now we have a bug-free language. Tongue removed from cheek... The Python policy is a *lot* easier to work with than REXX's policy is. In REXX, if you put a value in an IF statement that isn't its canonical True or False (in its case, "1" and "0"), you get a run-time error. Python lets you use None, False, 0, etc, as falsey, and if you really want a comparison, you put it in there. How is this a problem? As demonstrated elsewhere, the problem isn't the boolification. The problem is that an 'if' was used where exception handling would have been far better. ChrisA