Skip to content

0.7.0

Latest

Choose a tag to compare

@toloco toloco released this 13 Apr 17:08
Immutable release. Only release title and notes can be modified.
40e55c2

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 using ParamSpec — decorated functions retain their arg/return types
  • Added BaseCacheInfo protocol for the common cache info interface (hits, misses, max_size, current_size)
  • cache() return type updated from Callable[[F], F] to Callable[[Callable[P, R]], CachedCallable[P, R]]
  • Added _probe to _warp_cache_rs.pyi stub
  • typing_extensions dependency 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