I'm wondering if there is a construction in Python 3 that allows me to open two (or more) files on the same with
context.
What I'm looking for is something like this:
from pathlib import Path
file1 = Path('file1.txt')
file2 = Path('file2.txt')
with file1.open() as f1 and file2.open() as f2:
'''do something with file handles...
The code above is obviously invalid, which leads to this question.