Yes, if used as a class property, there is no special mechanism instated to use it as a method:
>>> class A:
... def f(a, b):
... print(a,b)
...
>>> type(A.f)
<class 'function'>
However:
>>> a=A()
>>> type(a.f)
<class 'method'>
>>> a.f('only one arg because a itself is supplied as first arg')
<__main__.A object at 0x76992b70> only one arg because a itself is supplied as first arg
When a plain (no staticmethod, no classmethod) function defined inside a class is called through an instance of the class, then it is called as a method, meaning the first argument (in this case a
but typically self
) will be automatically provided as the instance itself.