funcutils.py 337 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import inspect def requires_self(func): func_argc = len(inspect.getargspec(func).args) if func_argc == 0 or ( getattr( func, 'im_self', None) is not None) or ( hasattr( func, '__self__')): return False else: return True