itertools: followup to Alex Martelli problem ("number-in-base" ``oneliner'') and Bengt Richter solution

anton muhin antonmuhin at rambler.ru
Mon Nov 1 08:02:14 EST 2004


Oops, it not y-combinator itself, but rather releated thing, sorry.

And as followup: iter(callable, sentinel) seems a little bit too 
restricted for me. The reason is simple: no params are passed to 
callable and, therefore, it is usually should return the same value. Of 
course, there are a lot of callable things in Python that don't behave 
this way, but shouldn't iter have interface like iter(callable, params) 
that would generated iterator [x, f(x), f(f(x)), ...] that can be stoped 
with itertools.takewhile if needed?

with the best regards,
anton.



More information about the Python-list mailing list