Remove get_arity

This function wasn't being used anywhere.
This commit is contained in:
Kodi Arfer 2018-11-08 22:46:01 -06:00 committed by Brandon T. Willard
parent 4132adb9fe
commit 701db83ba9

View File

@ -11,9 +11,6 @@ try:
# Otherwise fallback to the legacy getargspec.
inspect.signature # noqa
except AttributeError:
def get_arity(fn):
return len(inspect.getargspec(fn)[0])
def has_kwargs(fn):
argspec = inspect.getargspec(fn)
return argspec.keywords is not None
@ -23,11 +20,6 @@ except AttributeError:
return inspect.formatargspec(*argspec)
else:
def get_arity(fn):
parameters = inspect.signature(fn).parameters
return sum(1 for param in parameters.values()
if param.kind == param.POSITIONAL_OR_KEYWORD)
def has_kwargs(fn):
parameters = inspect.signature(fn).parameters
return any(param.kind == param.VAR_KEYWORD