It would be nice if
function_key_generator would support methods in addition to plain functions.
An example implementation is here: https://github.com/ZeitOnline/pyramid_dogpile_cache2/blob/1.0.1/src/pyramid_dogpile_cache2/cache.py#L26
I haven't found a way to do this other than computing the
namespace during each function call (instead of only once and storing it in the closure), since at definition time I think you don't have enough information about the function etc. available.