1 > 0 == True -> False

Chris Angelico rosuav at gmail.com
Thu Jan 30 14:48:21 EST 2014


 Fri, Jan 31, 2014 at 6:22 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
> On 01/30/2014 11:03 AM, Chris Angelico wrote:
>
>> On Fri, Jan 31, 2014 at 5:56 AM, Roy Smith wrote:
>>>
>>>
>>> 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.
>
>
> How so?
>

Well, if x is an integer, then they're the same. If it's floating
point, I think they're the same, but don't quote me on that. But for
arbitrary types, there's no way of knowing what x+1 will result in.

ChrisA



More information about the Python-list mailing list