Python Class With Callback Function Explained In Math