Skip to content

Conversation

@lysnikolaou
Copy link
Member

@lysnikolaou lysnikolaou commented Dec 10, 2025

I'm opening this to start a discussion on what we want the structure of such documentation to be, as well as how to balance detail with succinctness. Feedback very welcome!


📚 Documentation preview 📚: https://cpython-previews--142519.org.readthedocs.build/en/142519/library/stdtypes.html#lists

@lysnikolaou lysnikolaou force-pushed the list-thread-safety-docs branch from 1858ef5 to fd400f0 Compare December 10, 2025 15:07
@emmatyping
Copy link
Member

Merged main to fix CI

@emmatyping
Copy link
Member

I think any note about the atomicity of list operations should probably go after the documentation about the type. I can imagine a beginner to Python going to the documentation to read about lists and being confused about what free-threading semantics are talking about.

I also wonder if this should not be a note. Perhaps it would be better to describe as part of the type description what operations are atomic and which are not?

Comment on lines +1383 to +1386
lst.append(item) # atomically appends item
lst.pop() # atomically removes and returns last item
lst[i] = value # atomically replaces item at index i
item = lst[i] # atomically retrieves item at index i
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Less horizontal scrolling on mobile:

Suggested change
lst.append(item) # atomically appends item
lst.pop() # atomically removes and returns last item
lst[i] = value # atomically replaces item at index i
item = lst[i] # atomically retrieves item at index i
lst.append(item) # atomically appends item
lst.pop() # atomically removes and returns last item
lst[i] = value # atomically replaces item at index i
item = lst[i] # atomically retrieves item at index i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants