[Python-3000] Equality of range objects

Benjamin Peterson musiccomposition at gmail.com
Tue Apr 8 23:49:38 CEST 2008


On Tue, Apr 8, 2008 at 4:43 PM, Brett Cannon <brett at python.org> wrote:
> On Tue, Apr 8, 2008 at 2:34 PM, Benjamin Peterson
>
> <musiccomposition at gmail.com> wrote:
>  > On Tue, Apr 8, 2008 at 4:29 PM, Guido van Rossum <guido at python.org> wrote:
>  >  > On Tue, Apr 8, 2008 at 1:27 PM, Benjamin Peterson
>  >  >  <musiccomposition at gmail.com> wrote:
>  >  >  > Is there a reason this is not implemented, though? It's seems to me
>  >  >  >  they should be equivalent.
>  >  >
>  >  >  Where's the use case?
>  >  Education. the range object describes a set of integers from one point
>  >  to another, so to a new Python student having them not equivalent
>  >  can't be helpful.
>
>  That's not good enough. You could say that for almost anything. Plus
>  it just becomes that much more code and feature-set to maintain.
range is one of the first functions introduced in teaching Python.
How about this similar implemented behavior:
>>> {"1":2}.keys() == {"1":2}.keys()
True
>
>  -Brett
>



-- 
Cheers,
Benjamin Peterson


More information about the Python-3000 mailing list