[EMAIL PROTECTED] schrieb:
> Hello all,
>
> in python2.4, i read lines from a file with
>
> for lineNum, line in enumerate(f): ...
>
> However, lineNum soon overflows and starts counting backwards. How do
> i force enumerate to return long integer?
Most probably you can't, because it is a C-written function I presume.
But as python 2.4 has generators, it's ease to create an enumerate yourself:
def lenumerate(f):
i = 0
for line in f:
yield i, line
i += 1
Diez
--
http://mail.python.org/mailman/listinfo/python-list