[Python-Dev] Enhancing `iter'

Greg Ewing greg at cosc.canterbury.ac.nz
Wed Feb 18 19:20:34 EST 2004


Miki Tebeka <miki.tebeka at zoran.com>:

> 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.

I think there should be a different function for this,
rather than overloading it onto iter() by type-testing
the second argument, which is rather un-Pythonic.

BTW, I never knew iter() had a second argument. Having
just looked up what it means, I think it was a mistake
to put even the existing two functionalities into one]
function -- especially given the comment in the docs
about it doing "very different things depending on the
presence of the second argument"!

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list