def attr_item_call_auto_cache(func):
def __missing__(self, key):<EOL><INDENT>result = self[key] = func(key)<EOL>return result<EOL><DEDENT>wrapper = type(snake2ucamel(func.__name__), (dict,), {<EOL>"<STR_LIT>": __missing__,<EOL>"<STR_LIT>": dict.__getitem__,<EOL>"<STR_LIT>": dict.__getitem__,<EOL>"<STR_LIT>": func.__doc__, <EOL>"<STR_LIT>": func.__module__,<EOL>})()<EOL>for k, v in vars(func).items():<EOL><INDENT>setattr(wrapper, k, v)<EOL><DEDENT>return wrapper<EOL>
Decorator for a a single positional argument function to cache
its results and to make ``f("a") == f["a"] == f.a``.