Hi,
I have a class SubDevice
with a function action
.
For each instance of SubDevice I want to define another action, so it's a parameter of SubDevice's class constructor.
Now some of the action functions need additional parameters, but that's normally not a problem because I can write something like
sd1 = SubDevice(action=lambda: f1(param1, param2))
But how do I pass the instance of SubDevice
as a parameter of the action
function? I can't use self
, because self refers to the class Device
, where I instantiate SubDevice
.
Thank you
Johannes Riecken