This might be pushing things a little too far, but mostly out of curiosity..
Would it be possible to have a callable object (function/class) that acts as both a Context Manager and a decorator at the same time:
def xxx(*args, **kw):
    # or as a class
@xxx(foo, bar)
def im_decorated(a, b):
    print('do the stuff')
with xxx(foo, bar):
    print('do the stuff')
 
     
     
     
     
     
    