Re: [Python-ideas] a bad feature in Python syntax

2017-03-01 Thread Rhodri James
On 01/03/17 02:56, 语言破碎处 wrote: I'm bited once: >>> '' in {} == False False >>> ('' in {}) == False True # '' in {} == False ==>> ('' in {}) and ({} == False) ==>> False! I think only compare operations should be chained. I think comparing against False (or True) is bad id

Re: [Python-ideas] a bad feature in Python syntax

2017-02-28 Thread David Mertz
OK, I'm impressed! I've written about and taught Python for almost 20 years. I never realized `in` was a chained comparison. I'm pretty sure I've never seen it used that way "in the wild." I also never tried using `is` in a chained way until just now. That said, there are at least three things

Re: [Python-ideas] a bad feature in Python syntax

2017-02-28 Thread Chris Angelico
On Wed, Mar 1, 2017 at 1:56 PM, 语言破碎处 wrote: > I'm bited once: > >>> '' in {} == False > False > >>> ('' in {}) == False > True > > # '' in {} == False ==>> ('' in {}) and ({} == False) ==>> False! > > I think only compare operations should be chained. I do feel your pain, but