The Python GIL protects bytecodes, not Python instructions (see short or long explanations). Since python implements both copy.copy() and copy.deepcopy() , they are certainly more than one bytecode, so no, they are not thread safe!
If you have to work with multiple threads, and there are many cases that you need, for example, for dedicated IO threads, do what needs to be done - use threading.Lock() . Please note that you can use an elegant element with an expression with a lock object .
source share