python: cache diet option for better performance