I have a method with multiple with
variables:
def my_method():
with A() as a, \
B() as b, \
C(a) as c, \
...
X() as x:
...
Now, in order to repeat this with
in a couple of methods, I would like to export it to a method of its own.
Is there any syntax that will allow me to do that?
def needed_with_params():
return (A(), B(), C(a), ..., X())
def my_method():
with needed_with_params() as tuple:
...
Which is of course is not correct, but shows my intention.