1 > 0 == True -> False

Chris Angelico rosuav at gmail.com
Thu Jan 30 14:03:42 EST 2014


On Fri, Jan 31, 2014 at 5:56 AM, Roy Smith <roy at panix.com> wrote:
> On Thursday, January 30, 2014 10:09:03 AM UTC-5, Steven D'Aprano wrote:
>
>>     E.g. `x+1 > 0 and y >= 5` is potentially as many as 9 distinct
>>     items to keep in short-term memory. But bracketing some terms
>>     as in `(x+1 > 0) and (y >= 5)` can reduce that down to as few
>>     as two items.
>
> Yes, that's probably how I would write that, although, this is even simpler:
>
> (x > -1) and (y >= 5)

Be careful; that's not the same thing.

ChrisA



More information about the Python-list mailing list