MCPcopy
hub / github.com/django/django / method_has_no_args

Function method_has_no_args

django/utils/inspect.py:83–86  ·  view source on GitHub ↗

Return True if a method only accepts 'self'.

(meth)

Source from the content-addressed store, hash-verified

81
82
83def 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
89def func_supports_parameter(func, name):

Callers 3

get_context_dataMethod · 0.90
countMethod · 0.90
acountMethod · 0.90

Calls 1

_get_callable_parametersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…