sec
public text v1 · immutable#!/usr/bin/env pythonclass A(object): passcache = {}def memo(c): if not c in cache: cache[c] = c() return cache[c]a, b = A(), A()print a, bc, d = memo(A), memo(A)print c, d#!/usr/bin/env pythonclass A(object): passcache = {}def memo(c): if not c in cache: cache[c] = c() return cache[c]a, b = A(), A()print a, bc, d = memo(A), memo(A)print c, d