Skip to content

Instantly share code, notes, and snippets.

View rjmunro's full-sized avatar

Robert (Jamie) Munro rjmunro

View GitHub Profile
@rjmunro
rjmunro / friendly.py
Last active December 10, 2015 09:48 — forked from anonymous/friendly.py
def memoize(f):
cache= {}
def memf(*x):
if x not in cache:
cache[x] = f(*x)
return cache[x]
return memf
@memoize
def sum_factors(x):