Skip to content

Instantly share code, notes, and snippets.

View danbednarski's full-sized avatar
🎃
sh.open(you.laptop, "echo 'cool network!'")

Dan Bednarski danbednarski

🎃
sh.open(you.laptop, "echo 'cool network!'")
View GitHub Profile
@danbednarski
danbednarski / memoizers.py
Last active April 12, 2025 17:35
Comparing simple handrolled memoization to @cache decorator from functools
# curiosity piqued by this note: https://substack.com/@pythonclcoding/note/c-107253391
from functools import cache
@cache
def fib_cache(n):
if n <= 1:
return n
return fib_cache(n-1)+fib_cache(n-2)