[Python-3000] Using range()

Guido van Rossum guido at python.org
Thu Apr 24 22:21:37 CEST 2008


On Thu, Apr 24, 2008 at 1:01 PM, Mark Dickinson <dickinsm at gmail.com> wrote:
> It seems to me that there are two reasonable behaviours
> for range(a, b) when b is less than a:  return an 'empty' range,
> as in the example above, or raise a ValueError;

Don't even think about suggesting to change this. It matches the
behavior of slices:

>>> a = 'abc'
>>> a[2:1]
''
>>>

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list