def serialize_call(args, kw, argnames, defaults):
    """Serialize args/kw into cache key."""
    call = list(args)
    for name in argnames[len(args):]:
        try:
            arg = kw[name]
        except KeyError:
            arg = defaults[name]
        call.append(arg)
    return tuple(call)
