def keywords(func):
 if isinstance(func, type):
  return keywords(func.__init__)
 elif isinstance(func, partial):
  return keywords(func.func)
 return inspect.getargspec(func).args

def keywords ( func ) : if isinstance ( func , type ) : return keywords ( func . __init__ ) elif isinstance ( func , partial ) : return keywords ( func . func ) return inspect . getargspec ( func ) . args
returns a sorted list of keywords in the given string .