class mc:
def show(self):
self.func()
a = mc()
def myfunc(self):
print('instance function')
a.func = myfunc
a.show()
The above does not work: TypeError: myfunc() missing 1 required positional argument: 'self'.
Why is the instance name not automatically inserted by Python, considering that I'm using dot notation?
myfuncI would expect it to be a regular function that you are just storing as thefuncattrbute of a particuar instance of mc.