[docs] threading.Lock.release Documentation

Georg Brandl georg at python.org
Thu Apr 5 09:09:02 CEST 2012


Am 04.04.2012 17:51, schrieb W. Austin Roberts:
> I recently ran into a situation where I could not be certain that a lock 
> was currently in the acquired state. I checked the documentation to 
> determine what would happen if I attempted to release a lock that was 
> already released, and saw an ominous warning of "Do not call this method 
> when the lock is unlocked."
> 
> Needing to know what would happen, I cautiously tested it out. I half 
> expected my computer to explode as I released a lock for the second 
> time, but was pleased to see it raise a 'thread.error' exception which 
> could be caught and handled.
> 
> I generally expect the documentation to tell me what will happen if I do 
> something invalid. In this case the documentation should indicate that a 
> thread.error will be raised if you release an unlocked lock.
> 
> Thanks for your time.
> 

Thanks for the note, Austin.  I agree with you and I've opened #14502 at
bugs.python.org to track the issue.

cheers,
Georg


More information about the docs mailing list