Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: True == 1 weirdness Date: Wed, 16 Sep 2015 17:27:28 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 31 Message-ID: References: <0b949fe0-09b4-46b0-b4ac-a85a9bfebfd5@googlegroups.com> <1442412230.1762717.385286049.20841F36@webmail.messagingengine.com> <87oah2jq4y.fsf@elektro.pacujo.net> <55F99ADB.5020405@mail.de> <1442422672.1804523.385461961.6F1DFD96@webmail.messagingengine.com> NNTP-Posting-Host: 67-130-15-94.dia.static.qwest.net X-Trace: reader1.panix.com 1442424448 5898 67.130.15.94 (16 Sep 2015 17:27:28 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 16 Sep 2015 17:27:28 +0000 (UTC) User-Agent: slrn/1.0.2 (Linux) Xref: csiph.com comp.lang.python:96695 On 2015-09-16, Sven R. Kunze wrote: > On 16.09.2015 18:57, Random832 wrote: >> I think that chaining should be limited to: >> >> A) all operators are "=" >> B) all operators are "is" >> C) all operators are either >= or > >> D) all operators are either <= or < > > That certainly would be a fine guideline. Only use it with all operators > the same. I find that the only times I use chaining (intentionally), are in cases C and D. All other instances of chaining in my code are invariably typos/bugs. > Everything else might cause headaches. I'm not all that sure A and B should be allowed. > Restricting it language-wise? I don't know. I have to admit I've never > seen this in production anyway. Most languages I see people working with > don't have this feature at all. So, they don't know it exists in Python. I use C and D intentionally, and have tripped accidentally over other cases. -- Grant Edwards grant.b.edwards Yow! Hey, waiter! I want at a NEW SHIRT and a PONY TAIL gmail.com with lemon sauce!