https://link.springer.com/referenceworkentry/10.1007/978-0-3...
Under the section 'General Races and Data Races', then 'Data race'. There's a definition of data races, in relation to general races.
"A data race is a special case of a general race. A data race exists between conflicting memory accesses..."
Why? Who defines that?
We wouldn't expect this to be atomic, because the get_value() function could do tons of things, and we don't expect all that to be atomic. It doesn't make sense to call something atomic just because the user wrote it.
and yes, as everyone is saying, the gil keeps the python interpreter/runtime from ending up in an inconsistent state... its behavior should not be depended on by user programs. if you need to increment a counter, use a lock, or a counter that explicitly states that it's a thread safe atomic counter on the tin.
The fact that "counter" gets modified between the read and the write doesn't imply that multiple accesses were happening simultaneously; it just means that accesses from different threads were getting interleaved. The GIL would only prevent the former but not the latter, since a thread can give up the GIL at any point between operations.