inclusive-lower-bound, exclusive-upper-bound (was Re: Range Operation pre-PEP)

Grant Edwards grante at visi.com
Fri May 11 14:05:51 EDT 2001


In article <3AFB0DB9.BDAE54A5 at one.net.au>, Andrew Maizels wrote:

>I can see where consistency is important, but why does Python do the
>inclusive-lower-bound, exclusive-upper-bound thing?

one reason is so that for 0 <= n < len(a),

    a[:n]+a[n:] == a
    
That property makes processing sections of lists much simpler.    

-- 
Grant Edwards                   grante             Yow!  I want to dress you
                                  at               up as TALLULAH BANKHEAD and
                               visi.com            cover you with VASELINE and
                                                   WHEAT THINS...



More information about the Python-list mailing list