[docs] [issue15097] Improving wording on the thread-safeness of import

Merlijn van Deen report at bugs.python.org
Sun Jun 17 17:38:47 CEST 2012


Merlijn van Deen <valhallasw at gmail.com> added the comment:

First off, thank you for your response.

> The existence of an import lock is deliberately omitted from the text,
> and the reader is supposed to abide by the restriction as written
> regardless of the motivation behind it.

> The entire notion of an import lock is obsolete. Python 3.3 does not
> have that anymore.

" This warning is still valid but for a different reason " or " this warning is no longer valid in 3.3 "?


Assuming the first (which is what I guess based on the fact the deadlock still occurs in 3.3), I think the text can still be improved; the current wording suggests to me

a) it's OK to wait for a thread as long as you did not create it

and

b) it's OK to import something that waits for a thread as long as you do it from the main module

 - while both cases can still lead to a deadlock. 

so, leaving the implementation details out, this is my suggestion:

"Firstly, an import should not have the side effect of waiting for a thread in any way. This can lead to a deadlock if that thread directly or indirectly attempts to import a module."

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15097>
_______________________________________


More information about the docs mailing list