@ccc , sorry for not being clear. It goes into the pyui file. Screenshot, below. Sorry, I left it full screen so it's clear to others also.

Edit: oops, that is creating a dynamic attr in pic. But it's the same place / same idea.

The eval is called on the CustomAtrributes, in the ui.py function _view_from_dict

Sorry a few edits: I rushed this. But the self.sayhello(1,2) evals() to calling a method of that name in our class. You can leave off the self and call a function, but I think from memory you have to return True, otherwise warnings are printed.
This seems very close to what the action method does , when it's defined inside the pyui file.