Serhiy Storchaka added the comment: Why not just use functools.lru_cache? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue21486> _______________________________________