[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Ben
Ben added the comment: The problem with the FAQs is that it's over-simplifying things to the point where it can sometimes mislead. Notably, it says the GIL protects these operations; but as Antoine points out, many operations on datatypes drop back into Python (including potential decrefs)

[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Jeff Allen
Jeff Allen added the comment: Thomas wrote: > it's as part of this discussion in > https://mail.python.org/archives/list/python-...@python.org/thread/ABR2L6BENNA6UPSPKV474HCS4LWT26GY/#IAOCDDCJ653NBED3G2J2YBWD7HHPFHT6 > and others in #python-dev That's where I noticed it, but it seemed the

[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: sort() is atomic, even if GIL is released during executing custom __lt__. It is guaranteed that no operations on the list in other threads can affect the result of sort(). I do not understand what non-atomic you see in x = L[i]. The value of x is

[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: Jeff makes an excellent point about the docs failing to distinguish between language guarantees, implementation guarantees, and things which are merely true sometimes. On the other hand, we only need document what is true *now*, not what may be true in

[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Antoine Pitrou
Antoine Pitrou 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

[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Thomas Grainger
Thomas Grainger added the comment: it's as part of this discussion in https://mail.python.org/archives/list/python-...@python.org/thread/ABR2L6BENNA6UPSPKV474HCS4LWT26GY/#IAOCDDCJ653NBED3G2J2YBWD7HHPFHT6 and others in #python-dev specifically

[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Jeff Allen
Jeff Allen added the comment: I'm interested in Thomas' reasons, but here are some of mine (as far as I understand things): 1. It is specific to one interpreter implemented in C, equipped with a GIL, and on certain assumptions about the byte code interpreter and the implementation of

[issue45435] delete misleading faq entry about atomic operations

2021-10-11 Thread Steven D'Aprano
New submission from Steven D'Aprano : Why do you say that the FAQ is misleading? If it is misleading, it should be replaced with a more correct answer, not just deleted. -- nosy: +steven.daprano ___ Python tracker

[issue45435] delete misleading faq entry about atomic operations

2021-10-11 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +27181 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28886 ___ Python tracker ___

[issue45435] delete misleading faq entry about atomic operations

2021-10-11 Thread Thomas Grainger
Change by Thomas Grainger : -- assignee: docs@python components: Documentation nosy: docs@python, graingert priority: normal severity: normal status: open title: delete misleading faq entry about atomic operations ___ Python tracker