![](https://secure.gravatar.com/avatar/f3ba3ecffd20251d73749afbfa636786.jpg?s=120&d=mm&r=g)
Oct. 4, 2011
7:06 p.m.
On Tue, Oct 4, 2011 at 1:59 PM, Eli Bendersky <eliben@gmail.com> wrote:
This is useful, and made simpler by contextlib.contextmanager.
Yeah, the only reason I wrote it out by hand is that if it *did* go into the io module, we wouldn't want to depend on contextlib for it. However, as Antoine pointed out, it only works for seekable streams and probably isn't general purpose enough to actually be included in the io module. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia