Naive Implementation of Automatic Memoisation
This looks good to me and I have nothing important to add.


the nonlocal are not required here
in the code sample, you could use the @decorator syntax
maybe you could write something more generic than just functions taking a single parameter.