I am trying to understand how class methods are called when defined externally. Although I found other topics dedicated to this problem, I did not find a very clear answer to my question, so I want to publish it in a simple form.
Defines a function outside the class and calls it from the inside, the same as defining it from the inside.
def my_func(self_class, arg): do something with arg return something class MyClass: function = my_func
vs
class MyClass: def function(self, arg): do something with arg return something
and then calling him
object = MyClass() object.function(arg)
Thanks in advance.
Diego source share