[docs] Incorrect documentation in threading.Lock?
Koskinen Tapio
tapio.koskinen at insta.fi
Mon Feb 25 03:00:21 EST 2019
Hi Julien,
Thank you for the clarification. It took a while but made sense in the end. IMHO it would we clearer if the paragraph explaining the blocking=False -case would not talk about blocking=True but instead referred to lock’s state like you mentioned, but maybe that’s just me.
Thanks,
Tapio Koskinen
From: Julien Palard <julien at palard.fr>
Sent: perjantai 22. helmikuuta 2019 16.40
To: Koskinen Tapio <tapio.koskinen at insta.fi>
Cc: docs at python.org
Subject: Re: [docs] Incorrect documentation in threading.Lock?
Hi Koskinen, thanks for asking!
> Shouldn't the second paragraph's second sentence start with "If a call with blocking set to *False* would block..."?
It would cover an unexisting case: calling with blocking set to *False* won't block anyway, so "if blocking is false would block" is the impossible case, only calls with blocking=True can block.
The idea of those tangled sentences is to state that when the function is called with blocking=False and the lock is already held, the function returns *False*.
Instead of writing "and the lock is already held" the documentation write the equivalent: if the call would have blocked if called with blocking=True ("If a call with blocking set to True would block" in the doc).
Bests,
--
Julien Palard
https://mdk.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20190225/29b85a8a/attachment.html>
More information about the docs
mailing list