Changelog
Improve typing coverage with ParamSpec + Protocol (#27)
Type checkers now see cache_info() and cache_clear() on decorated functions, while preserving the original call signature:
- Added
CachedCallable[P, R]protocol usingParamSpec— decorated functions retain their arg/return types - Added
BaseCacheInfoprotocol for the common cache info interface (hits, misses, max_size, current_size) cache()return type updated fromCallable[[F], F]toCallable[[Callable[P, R]], CachedCallable[P, R]]- Added
_probeto_warp_cache_rs.pyistub typing_extensionsdependency added for Python 3.9 only
Document key serialization behavior (#28)
Added "Key serialization behavior" section to docs/usage.md:
- How cache keys are formed from
*args/**kwargs(sorted kwargs for determinism) - Memory backend: Python objects,
hash(), single-process - Shared backend: fast-path binary format for primitives, pickle fallback
- Cross-process determinism: fixed-seed ahash, immune to
PYTHONHASHSEED