Python caching utilities