[Python-ideas] The async API of the future: Twisted and Deferreds
Greg Ewing
greg.ewing at canterbury.ac.nz
Sun Oct 14 08:24:55 CEST 2012
Devin Jeanpierre wrote (concerning callbacks):
> If we look at this, we're expecting to deal with a set of functions
> that manage shared data. The abstraction for this is usually an
> object, and we'd really probably write the callbacks in a class unless
> we were being contrarian. And it's not too crazy for the dispatcher to
> know this and expect you to write it as a class that supports a
> certain interface (certain methods correspond to certain events).
IIUC, what Guido objects to is callbacks that are methods *of the
I/O object*, so that you have to subclass the library-supplied
object and override them.
You seem to be talking about something slightly different -- an
object that's entirely supplied by the user, and simply bundles
a set of callbacks together. That doesn't seem so bad.
--
Greg
More information about the Python-ideas
mailing list