[issue3957] [contextlib] Reverse order of locking

2010-04-29 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue3957] [contextlib] Reverse order of locking

2008-09-24 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: This doesn't sound like such a good idea. In the example you gave, it is trivial and easier to use two separate with statements than three! -- nosy: +benjamin.peterson resolution: -> rejected status: open -> pending _

[issue3957] [contextlib] Reverse order of locking

2008-09-24 Thread David Naylor
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

[issue3957] [contextlib] Reverse order of locking

2008-09-24 Thread David Naylor
New submission from David Naylor <[EMAIL PROTECTED]>: Overview: Add a generator that will revert the order applied to a with statement. Motivation: Often with threaded applications one needs to do a certain task outside of a lock but while inside a greater block of code protected by a lock.