Return True if a method only accepts 'self'.
(meth)
| 81 | |
| 82 | |
| 83 | def method_has_no_args(meth): |
| 84 | """Return True if a method only accepts 'self'.""" |
| 85 | count = len([p for p in _get_callable_parameters(meth) if p.kind in ARG_KINDS]) |
| 86 | return count == 0 if inspect.ismethod(meth) else count == 1 |
| 87 | |
| 88 | |
| 89 | def func_supports_parameter(func, name): |
no test coverage detected
searching dependent graphs…