New submission from Stavros Korokithakis:
Currently, the new with statement does not support multiple handlers.
For example, to open two files for input/output you would have to do:
with open(filein) as input:
with open(fileout) as output:
#Do stuff
pass
This adds
Stavros Korokithakis added the comment:
What this syntax does is similar to the nested context manager in case
12 of PEP343, but with cleaner syntax.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1435
__
Changes by Christian Heimes:
--
components: +Interpreter Core -None
priority: - low
type: behavior - rfe
versions: +Python 2.6
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1435
__
Guido van Rossum added the comment:
I don't think the added syntactic complexity is worth the relatively
rare use case, especially since there's already an implementation of
nested() in the contextlib library.
--
nosy: +gvanrossum
resolution: - wont fix
status: open - closed