[Python-Dev] Inclusive Range

Benjamin Peterson benjamin at python.org
Mon Oct 4 06:00:31 CEST 2010


2010/10/3 Eviatar Bach <eviatarbach at gmail.com>:
> Hello,
>
> I have a proposal

See the python-ideas mailing list.

> of making the range() function inclusive; that is,
> range(3) would generate 0, 1, 2, and 3, as opposed to 0, 1, and 2. Not only
> is it more intuitive, it also seems to be used often, with coders often
> writing range(0, example+1) to get the intended result. It would be easy to
> implement, and though significant, is not any more drastic than changing
> print to a function in Python 3..

Yes, it is. It's much more subtle.

>
> What are your thoughts?

Completely backwards incompatible. -1


-- 
Regards,
Benjamin


More information about the Python-Dev mailing list