It's already easy to write race conditions in Python.
if x in d:
del d[x]
else:
d[x] = True
Is a classic example -- if two threads execute that, you can't predict the outcome (but a KeyError is quite likely)
The GIL only protects the CPython virtual machine; it doesn't protect user code. Concurrent code with shared mutable state already needs explicit mutexes.
The GIL only protects the CPython virtual machine; it doesn't protect user code. Concurrent code with shared mutable state already needs explicit mutexes.