Hello All, Currently `iter' 2'nd parameter is used for comparison. I'd like to have the ability to give a function that will determine weather to stop or not. iter(range(10), lambda x: x > 7) will stop at 8. (There reverse logic might be uses as well: continue as long a `sentinal' returns True.) The only problem I can see is that someone might want to use a function object as a sentinal, then `iter' won't know if to call the function or to compare. However this seems very rare and can be solved by: def f(x, y): .... iter(something, lambda x: x == f) Any thoughts/objections? Bye. -- ------------------------------------------------------------------------- Miki Tebeka <miki.tebeka at zoran.com> http://www.cs.bgu.ac.il/~tebeka The only difference between children and adults is the price of the toys.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4