A docstring here would be helpful. `set_memo()` is a somewhat misleading name, as one might expect it to mutate the `self` object.