diff options
| author | Josh Schneier <josh.schneier@gmail.com> | 2018-08-06 23:12:51 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-08-07 17:37:35 -0400 |
| commit | 756b859576503a5dae7886bd1f2bbc3fe56ee1f7 (patch) | |
| tree | dfe06981f42a877d2b28306763a858f166f7de8d /django/utils | |
| parent | 155b31d4ec138664d62665eb2d8a442469045b78 (diff) | |
Renamed django.utils.inspect.func_has_no_args() to method_has_no_args().
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/inspect.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/utils/inspect.py b/django/utils/inspect.py index 355cac48f3..15cd7fbc45 100644 --- a/django/utils/inspect.py +++ b/django/utils/inspect.py @@ -50,9 +50,10 @@ def func_accepts_var_args(func): ) -def func_has_no_args(func): +def method_has_no_args(meth): + """Return True if a method only accepts 'self'.""" args = [ - p for p in inspect.signature(func).parameters.values() + p for p in inspect.signature(meth).parameters.values() if p.kind == p.POSITIONAL_OR_KEYWORD ] return len(args) == 1 |
