xlocal is a library for execution-local storage, providing a cleaner alternative to thread-local (and global) mutable state. It supports both thread-based and asynchronous (asyncio) contexts, and its variables are scope-safe and automatically cleaned up. Current version is 0.5; the library is in maintenance mode with rare releases.
pip install xlocalNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create an execution-local variable with a default factory.
Wrap expensive initialization in a `lru_cache` or similar to avoid repeated calls.
Use xlocal only for context-local data, not for cross-context communication.
Replace `from xlocal import Proxy` with `from xlocal import ExecutionLocal`.
No dependency data recorded yet.