Hi,

Jelle Feringa wrote:
> Thanks for your response; any suggestion what might be more efficient  
> than a __getitem__ call?
> Or is this class doomed by design?

I would call it doomed by design. If you use it from Python, I don't think
you can beat direct iteration through __getitem__ *of the object* that you
iterate over by introducing another level of indirection that introduces a
method call. I tried islice() and it's still a bit faster than the class
you presented.

Maybe you could give us some more insight into your actual use case, that
might allow us to come up with better alternatives.

Stefan

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

Reply via email to