Python PyQt signals are not always working

Solution 1:

The problem is caused because the PyCalcCtrl object is not assigned to a variable so it will be destroyed and therefore the "_printthis" method will not be accessible. On the other hand, when functools.partial is used then the object of the PyCalcCtrl class is assigned to the scope of that function, that's why it works.

The solution is to assign the PyCalcCtrl object to a variable:

ctrl = PyCalcCtrl(model=model, view=view)