i have a module with many functions defined in it. Is there a way to inherit all these functions into a class i have in another module.
say i have module1 with function func1(), func2()
I have another module module2 where i have a class
class class1:
def __init__(self):
.....
def func3(self):
....
I want to inherit func1() and func2() from module1 into class1. So any object of class1 should be able to access these functions.
obj1 = class1()
I should be able to do obj1.func1()
Is there a way to acheive this in python
from module1 import class1.func3clsorselfrespectively. Anyway, this is not a good approach.