newbie question

Diez B. Roggisch deetsNOSPAM at web.de
Sun Dec 19 16:48:27 CET 2004


> It works as if you had written:
> 
> for _i in xrange(len(myList)):
> x = myList(_i)

No, as this implies that the variable has to support random access using
indices. But all that's required is the iterable-interface beeing supported
- by calling __iter__ and .next() on the resulting object.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list