[New-bugs-announce] [issue11194] "lock.__exit__ == lock.release" should be False

O.C. report at bugs.python.org
Fri Feb 11 18:40:58 CET 2011

New submission from O.C. <oc-spam66 at laposte.net>:


if 'lock' is a threading.Lock, the functions lock.__exit__() and lock.release() are different. The former takes 3 arguments, while the latter takes no argument. However, "lock.__exit__ == lock.release" returns True. Shouldn't it return False ?

Best regards,


In [20]: lock=threading.Lock()
In [21]: lock.acquire()
In [22]: lock.__exit__(None,None,None)
In [23]: lock.locked()
Out[23]: False
In [24]: lock.acquire()
In [25]: lock.release(None,None,None)
TypeError: release() takes no arguments (3 given)
In [26]: lock.__exit__==lock.release
Out[26]: True

components: Library (Lib)
messages: 128409
nosy: dghjfrdj
priority: normal
severity: normal
status: open
title: "lock.__exit__ == lock.release" should be False
type: behavior
versions: Python 3.1

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list