> I __next__ falls in the category of special methods, please read the  
> fine docs
> http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/special_methods.html

Right, I've read the document.

> Declare __next__ with 'def', they are treated specially and are as
> fast as the CPython implementation permits.

Aha, I see, that I didn't know.
I noticed that the cython iterator is about twice as fast compared to  
the python version, when indexing an iterable object.
A respectable speedup, given how trivial the implementation is. Would  
you consider the implementation optimal? Is this the fastest way of  
indexing an iterable object?

Many thanks Lisandro.

-jelle

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to