David Naylor <[EMAIL PROTECTED]> added the comment:

Apologies, obviously the invert function should be preceded by an 
@contextmanager to become:

@contextmanager
def invert(thing):
  thing.__exit__(None, None, None)
  yield thing
  thing.__enter__()

[Although there may be a better way of doing this, perhaps as a 
class?]

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3957>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to