[Twisted-web] Class methods as callbacks/errbacks
gelonida at gmail.com
Sun Jun 5 10:11:53 EDT 2011
On 06/05/2011 10:44 AM, Phil Mayers wrote:
>> Is there an alternative and/or cleaner solution to specify a class
>> method as a callback or errback?
> Just pass the instance method directly to addCallback:
You can either specify a bound class method or an unbound.
I guess you'd like to have a bound callback, but I don't know your
obj_callback = some_object.method_name # bound method
class_callback = some_class.method_name # unbound method
so the usage would be
More information about the Twisted-web