per() for line in with_iter(open('foo'))) Any context manager which returns an iterable is a candidate for ``with_iter``. Nr³