8000 Document the thread safety of `functools.lru_cache` · Issue #93179 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Document the thread safety of functools.lru_cache #93179
Closed
@pfmoore

Description

@pfmoore

Documentation

The documentation doesn't state whether functools.lru_cache (and decorators derived from it like functools.cache) are thread safe, meaning that it's not clear that it's safe to (for example) populate the cache by running the function in multiple threads. The comments in the source code certainly imply that it's intended to be thread safe, but I'll admit I haven't double checked all the details.

Can the thread safety be made explicit in the docs?

Linked PRs

Metadata

Metadata

Assignees

Labels

docsDocumentation in the Doc dir

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0