Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
from inspect import getargspec
def filter_dict(d, fltr):
return dict( (x, d[x]) for x in fltr if x in d )
def apply_some(f, *args, **kwargs):
fspec = getargspec(f)
return f(*args, **kwargs) if fspec.keywords else f( *args, **filter_dict(kwargs, fspec.args) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.