Nick Coghlan wrote: > "Loop on this iterator and finalise when done" would be written: > > for item in itr: > process(item) > finally: > pass
This is approaching things from the wrong end. The user of an iterator shouldn't need to know or care whether it requires finalization -- it should Just Work, whatever context it is used in. Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com