[issue11194] "lock.__exit__ == lock.release" should be False
report at bugs.python.org
Fri Feb 11 20:51:50 CET 2011
O.C. <oc-spam66 at laposte.net> added the comment:
> Do you have a use case that this impacts?
No, I can live with it. It was rather a point about clarity and consistency. For example, the difference between Lock and RLock:
lock.__exit__==lock.release -> True
rlock.__exit__==rlock.release -> False
We came on that topic when using 'with' statements with exceptions and 'returns'. I wanted to check and understand the details, and I was confused by the fact that:
- three arguments will be given to lock.__exit__()
- lock.__exit__ is "the same" as lock.release
- lock.release takes no argument
These propositions are all true, but seem contradictory. The meaning of "the same" is not obvious in this case.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list