On 3/24/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: > On Thu, 2006-03-23 at 17:06 -0800, Guido van Rossum wrote: > > > The pattern with the 'empty' flag is only needed when due to API > > constraints you have only got an iterator. > > Which can happen quite often actually. Perhaps making the original > object available as an attribute of the iterator can help in those > situations though.
It can't work, at least not in general. How do you do this if the iterator is a generator? Or an infinite sequence? Or a filter? It can't be made part of the iterator protocol. You can design your own extension of the iterator protocol, but then it wouldn't accept arbitrary iterators any more. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com