[Python-bugs-list] [ python-Bugs-491820 ] asynchat.async_chat missing methods

noreply@sourceforge.net noreply@sourceforge.net
Tue, 11 Dec 2001 15:52:03 -0800


Bugs item #491820, was opened at 2001-12-11 15:51
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=491820&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Nobody/Anonymous (nobody)
Summary: asynchat.async_chat missing methods

Initial Comment:
asynchat.ascync_chat is an abstract class.  To use it
you have to 
subclass it and define (at least)
collect_incoming_data and 
found_terminator.  These
methods are both called from other 
asynchat_chat
methods.  They should probably be defined to 
raise
NotImplementedError.  This shuts up a couple
pychecker 
errors, but more importantly, makes it 
obvious to people 
reading the source code or running
pydoc that they are part of the 
formal interface.

I can't check anything in right now, but here 
are
a couple methods that I think should work.

def 
collect_incoming_data(self, data):
        raise 
NotImplementedError, "must be implemented in subclass"

def 
found_terminator(self):
        raise NotImplementedError, "must 
be implemented in subclass"



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=491820&group_id=5470