Skip to content

Instantly share code, notes, and snippets.

@John-Gee
Created November 30, 2018 03:33
Show Gist options
  • Save John-Gee/e55078b9eea523d33821c83bbc07e5f4 to your computer and use it in GitHub Desktop.
Save John-Gee/e55078b9eea523d33821c83bbc07e5f4 to your computer and use it in GitHub Desktop.
wrapper
# Taken from aiocache at https://github.com/argaen/aiocache/
# Copyright (c) 2016, Manuel Miranda de Cid
# License at https://github.com/argaen/aiocache/blob/master/LICENSE.txt
def key_from_args(func, args, kwargs):
ordered_kwargs = sorted(kwargs.items())
return (
(func.__module__ or "")
+ func.__name__
+ str(args)
+ str(ordered_kwargs)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment