N00b Python question
Go to solution
Solved by fizzlesticks,
object.bar is just a normal object. It has a __call__ member function that gets invoked when you call object.bar().
So object.bar() calls the object.bar object.
Libraries like pyqt need the reference to the object so they are able to invoke it whenever they need to. If you try passing object.bar() to set a listener your giving qt whatever the bar() method returns instead of the bar object itself.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now