Open dybber opened 3 years ago
Something like this?
try:
btn.clicked.connect(lambda x: button_spec.function(self.model))
except:
btn.clicked.connect(lambda x: button_spec.function())
Yes, but perhaps be explicit about only catching TypeError's, as we still wants the function to be able to fail with any other type of exception
I expect a lot of potential users/students will get this error:
Is it possible to try calling a method, first with the model parameter, and then pass it without it after? I know it's dirty, but in almost all cases the students will not need this parameter
Or should we just try removing it entirely, and see if that makes any problems? Then the setup/step functions should always refer to the global variable (e.g. epidemic_model) and not to the one passed in