Antoine Pitrou <pit...@free.fr> added the comment:

I'm also surprised to learn that `L.sort()` and `D1.update(D2)` are supposed to 
be atomic. They certainly are not in the general case.

Remember, any Python code can release the GIL (because the GIL is released 
periodically in the interpreter loop). Any DECREF can also release the GIL 
(because it may trigger the execution of arbitrary destructors). This restricts 
a lot which operations can be safely considered atomic.

----------
nosy: +pablogsal, pitrou, serhiy.storchaka
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45435>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to