python improvements -- simple caching