[Python-Dev] range objects in 3.x

Alexander Belopolsky alexander.belopolsky at gmail.com
Tue Sep 27 20:38:48 CEST 2011


On Tue, Sep 27, 2011 at 2:20 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
..
> Good points.  So how about:
>
> some_name_here(start, stop, *, step=None, count=None)
>

+1

The unusual optional first arguments is one of the things I dislike
about range().  Shouldn't step default to 1.0?  Also, when count is
given, stop can be elided.  This will make for a nice symmetry:
between stop, step and count any two can be provided but stop+step may
be problematic and we can warn about this choice in the docs.


More information about the Python-Dev mailing list