I like the convenience of the multiple context with
statement in Python 2.7:
with open('a.txt') as a, open('b.txt') as b:
do_many_amazing_things(a, b)
However, I need to maintain compatibility with 2.6.
with
was brought to 2.5 via __future__
, but I am unable to find anything about the multiple context version being back-ported to 2.6 in the documentation.
Is there something I missed?
EDIT: I am aware that is possible to nest with
statements. I am asking if it's possible to use multiple with statements.