[Shane Hathaway]
> If it's this simple, it should be possible to write something that
> combines the acquisition of multiple resources in a single statement.
> For example:
>
> with combining(opening(src_fn), opening(dst_fn, 'w')) as src, dst:
> copy(src, dst)
Yeah (and I don't see anything wrong with your implementation of
combining either), but even if that existed I think I'd prefer to just
write
with opening(src_fn) as src:
with opening(dst_fn) as dst:
copy(src, dst)
See Ma, no magic! :-)
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com