Problem with Python xrange

Christian Neumann mail at neumann-rosenheim.de
Sun Jun 6 14:16:02 EDT 2004


Hello,

 

i have a problem with the built-in function xrange(). Could you by any
chance be able to help?

 

I use Python 2.3.4 (final) and i think there is a bug in the built-in
function xrange().

 

An example is:

 

x = xrange(2, 11, 2)  ## [2, 4, 6, 8, 10]

 

I get an TypeError if i use it with SliceType:

 

x[1:4]  ## It should be return an xrange object with length 3

 

Here is the error message: 

 

"TypeError: sequence index must be integer".

 

Is this really a bug?

 

Sincerely yours,

 

Christian Neumann

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20040606/48798035/attachment.html>


More information about the Python-list mailing list