[Python-Dev] ValueErrors in range()

Guido van Rossum guido@python.org
Tue, 15 Apr 2003 08:42:43 -0400


> Current CVS raises ValueErrors for range() arguments
> of the wrong type:
> 
>  >>> range(0, "spam")
> Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
> ValueError: integer end argument expected, got str.
> 
> Shouldn't these be TypeErrors?

Right!  I did not review this code enough. :-(  Fixing now...

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