Robert Bradshaw wrote: > On Apr 26, 2009, at 9:04 AM, Dag Sverre Seljebotn wrote: >> Note that for STL iterators we also need *it rather than [0], so add >> "deref" to that list. Or possibly we just add * to Cython? >> >> We could then also move on to define the next builtin for C++ classes, >> which would translate like this: >> >> obj = next(it) >> >> would become >> >> cython.inc(it) >> obj = cython.deref(it) > > I could see supporting unary * as a native Cython operator (though > one would still want to be able to specify its type when operated on > a class overloading it).
Note that there would be an ambiguity with PEP 3132, though. We (and Pyrex) did pretty well without unary* for quite a while. I'd be very careful with adding it now. Especially for something like iterators, i.e. a concept that Python already has (even if it looks and works different in the two languages), and for which dereferencing is a totally unrelated concept from a Python POV. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
