Remove get_arity
This function wasn't being used anywhere.
This commit is contained in:
parent
4132adb9fe
commit
701db83ba9
@ -11,9 +11,6 @@ try:
|
|||||||
# Otherwise fallback to the legacy getargspec.
|
# Otherwise fallback to the legacy getargspec.
|
||||||
inspect.signature # noqa
|
inspect.signature # noqa
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
def get_arity(fn):
|
|
||||||
return len(inspect.getargspec(fn)[0])
|
|
||||||
|
|
||||||
def has_kwargs(fn):
|
def has_kwargs(fn):
|
||||||
argspec = inspect.getargspec(fn)
|
argspec = inspect.getargspec(fn)
|
||||||
return argspec.keywords is not None
|
return argspec.keywords is not None
|
||||||
@ -23,11 +20,6 @@ except AttributeError:
|
|||||||
return inspect.formatargspec(*argspec)
|
return inspect.formatargspec(*argspec)
|
||||||
|
|
||||||
else:
|
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):
|
def has_kwargs(fn):
|
||||||
parameters = inspect.signature(fn).parameters
|
parameters = inspect.signature(fn).parameters
|
||||||
return any(param.kind == param.VAR_KEYWORD
|
return any(param.kind == param.VAR_KEYWORD
|
||||||
|
Loading…
Reference in New Issue
Block a user