[Python-ideas] The async API of the future: Twisted and Deferreds

Guido van Rossum guido at python.org
Sun Oct 14 17:11:46 CEST 2012


On Sun, Oct 14, 2012 at 3:43 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> Subclassing IOObject would be wrong, since the user isn't writing an IO
> object in the first place. But subclassing a separate class, like
> Twisted's Protocol (which is mostly an empty shell, really), would sound
> reasonable to me.

It's a possible style. I'm inclined not to follow this example but I
could go either way. One thing that somewhat worries me is that the
names of these methods will be baked forever into all user code. As a
user I prefer to have control over the names of my methods; first,
there's the style issue (e.g. I'm always conflicted over what style to
use in unittest.TestCase subclasses, since its own style is setUp,
tearDown); second, in my app there may be a much better name for what
the method does than e.g. data_received(). (Not to mention that that's
another adjective used as a verb. ;-)

-- 
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list