"Raymond Hettinger" <[EMAIL PROTECTED]> 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. -- http://mail.python.org/mailman/listinfo/python-list