Ulrich Petri added the comment: So this would basically be:
with ExitStack() as stack: cm1 = stack.enter_context(a_long_name.with_a_long_method()) cm2 = stack.enter_context(another_long_variable.with_a_long_method()) Seems like a very non-obvious and inelegant solution... ---------- nosy: +ulope _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12782> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com