From 106bdd3b805ddc8dc30145f4e460cb9eaf044707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Fri, 12 Oct 2001 22:39:20 +0000 Subject: Correct __repr__: include module name, avoid extra space for empty status, use 0x format for id. Proposed by Cesar Eduardo Barros in patch #470680. --- Lib/asyncore.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 00b02e3..84f8a11 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -209,7 +209,7 @@ class dispatcher: def __repr__ (self): try: - status = [] + status = [self.__class__.__module__+"."+self.__class__.__name__] if self.accepting and self.addr: status.append ('listening') elif self.connected: @@ -219,8 +219,7 @@ class dispatcher: status.append ('%s:%d' % self.addr) else: status.append (self.addr) - return '<%s %s at %x>' % (self.__class__.__name__, - ' '.join (status), id (self)) + return '<%s at %#x>' % (' '.join (status), id (self)) except: pass -- cgit v0.12