python functool.cache

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2025 May 28 22:20
Editor
Edited
Edited
2025 May 28 22:20
Refs
Refs
from functools import cache @cache def expensive_calc(x): return x**2 + 42 print(expensive_calc(10)) # Calculates print(expensive_calc(10)) # Cached
 
 
 
 
 
 
 
 
 

Recommendations