As I am learning Django / Python right now, I have not yet used the concept of classes. As far as I know, this method is not static. This is just a standard definition.
So, let's say I have this package called Example1c views.pywhich contains this method:
def adder(x,y):
return x + y
Then I have one Example2, which also has views.pywhere I would like to use this method adder.
How can I do it?
EDIT: in Java, it will be a simple instance, and then instantiation.Method(), or if it was static, it will SomeClass.Method(), however, I'm not sure how I should approach this in Python.
source
share