[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-ideas
Subject:    Re: [Python-ideas] If I had the time machine for comparisons
From:       Scott Dial <scott+python-ideas () scottdial ! com>
Date:       2011-10-14 4:19:34
Message-ID: 4E97B856.8040609 () scottdial ! com
[Download RAW message or body]

On 10/13/2011 10:06 AM, Jim Jewett wrote:
> I think that
> 
>     range(3) < range(10)
> 
> is obviously true

Based on what property? Is that because:

  a) len(range(3)) < len(range(10))

  b) max(range(3)) < min(range(10))

  c) ((min(range(3)) < min(range(10)))
      and (max(range(3)) < max(range(10)))

I guess your argument is that in this degenerate case, all of these
properties are true so it is "obviously true". Personally, if I can't
pin-point the exact reason that "x < y", then it's not obvious even if
for every definition of "<" I can come up with it is a true statement,
because there is not one obvious definition that is true. In other
words, I don't know what "x < y" means for ranges in general so I can't
reason about it in general, therefore this special case is not useful or
obvious. In the absence of explicit arguments to the "<" operand, I
would be baffled as to what to expect as the result.

However, I can understand the desire to test for range equality, and the
definition for that is significantly more obvious.

-- 
Scott Dial
scott@scottdial.com
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
http://mail.python.org/mailman/listinfo/python-ideas
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic