[Python-ideas] The async API of the future: Reactors
Nick Coghlan
ncoghlan at gmail.com
Mon Oct 15 10:33:44 CEST 2012
On Mon, Oct 15, 2012 at 2:54 AM, Guido van Rossum <guido at python.org> wrote:
> On Sun, Oct 14, 2012 at 8:01 AM, Calvin Spealman <ironfroggy at gmail.com> wrote:
>> Why is subclassing a problem? It can be overused, but seems the right
>> thing to do in this case. You want a protocol that responds to new data by
>> echoing and tells the user when the connection was terminated? It makes
>> sense that this is a subclass: a special case of some class that handles the
>> base behavior.
>
> I replied to this in detail on the "Twisted and Deferreds" thread in
> an exchange. Summary: I'm -0 when it comes to subclassing protocol
> classes; -1 on subclassing objects that implement significant
> functionality.
This problem does seem tailor-made for a Protocol ABC - you can
inherit from it if you want, or call register() if you don't.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas
mailing list