[Python-bugs-list] [ python-Bugs-491820 ] asynchat.async_chat missing methods
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 08 Mar 2002 10:27:38 -0800
Bugs item #491820, was opened at 2001-12-11 18: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: Closed
>Resolution: Fixed
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"
----------------------------------------------------------------------
>Comment By: A.M. Kuchling (akuchling)
Date: 2002-03-08 13:27
Message:
Logged In: YES
user_id=11375
Good idea; done in rev. 1.16 of asynchat.py.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=491820&group_id=5470