[issue13487] inspect.getmodule fails when module imports change sys.modules

Gregory P. Smith report at bugs.python.org
Wed Mar 4 18:00:59 EST 2020


Gregory P. Smith <greg at krypto.org> added the comment:

Serhiy: Why is dict.copy() not thread safe?

if what you say of list(dict) being safe, iterating over that and looking up the keys would work.  But all of this is entirely non-obvious to the reader of the code.  all of these _look_ like they should be safe.

We should make dict.copy() safe and document the guarantee as such as that one could at least be explained when used for that purpose.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13487>
_______________________________________


More information about the Python-bugs-list mailing list