[Patches] [ python-Patches-460554 ] Fix asyncore.dispatcher.__repr__

noreply@sourceforge.net noreply@sourceforge.net
Tue, 11 Sep 2001 08:15:31 -0700


Patches item #460554, was opened at 2001-09-10 19:46
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=460554&group_id=5470

Category: Modules
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Cesar Eduardo Barros (cesarb)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix asyncore.dispatcher.__repr__

Initial Comment:
This patch fixes a bug that caused the __repr__ method
in asyncore.dispatcher to fail when self.addr was a tuple.

If it is accepted, you might also think of removing the
"import types" line and using type(()) instead of
types.TupleType; the types module is used only in that
line.

The patch is relative to version 1.17 of asyncore.py

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

Comment By: Martin v. Löwis (loewis)
Date: 2001-09-11 08:14

Message:
Logged In: YES 
user_id=21627

Thanks for the patch, I have committed it as asyncore.py
1.18.
Using type(()) is not recommended, since types.TupleType is
more explicit.
If anything, this could be changed to 

if type(self.addr) == tuple:

or isinstance(self.addr, tuple). However, such a change, if
desirable, should be made throughout the library.

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

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