Do you have real-world use cases for map's None fill-in feature?

Paul Rubin http
Tue Jan 10 04:05:40 EST 2006


"Raymond Hettinger" <python at rcn.com> writes:
> >    iterator = check_empty(iterator)
> 
> There are so many varieties of iterator that it's probably not workable
> to alter the iterator API for all of the them.  In any case, a broad
> API change like this would need its own PEP.

The hope was that it wouldn't be an API change, but rather just a new
function dropped into the existing library, that could wrap any
existing iterator without having to change or break anything that's
already been written.  Maybe the resulting iterator couldn't support
every operation, or maybe it could have a __getattr__ that delegates
everything except "next" to the wrapped iterator, or something.  The
obvious implementation methods that I can see are very kludgy but
maybe something better is feasible.  I defer to your knowledge about
this.



More information about the Python-list mailing list