def _make_key(self, *args, **kwargs):
def fixitems(items):<EOL><INDENT>ret = []<EOL>for k, v in items:<EOL><INDENT>if iterable(v): v = tuple(v)<EOL>ret.append((k,v))<EOL><DEDENT>return tuple(ret)<EOL><DEDENT>def fixlist(args):<EOL><INDENT>ret = []<EOL>for a in args:<EOL><INDENT>if iterable(a): a = tuple(a)<EOL>ret.append(a)<EOL><DEDENT>return tuple(ret)<EOL><DEDENT>key = fixlist(args), fixitems(kwargs.items())<EOL>return key<EOL>
make a hashable key out of args and kwargs