def peer2str(addr):
 if isinstance(addr, IPv4Address):
  res = u'tcp4:{0}:{1}'.format(addr.host, addr.port)
 elif (_HAS_IPV6 and isinstance(addr, IPv6Address)):
  res = u'tcp6:{0}:{1}'.format(addr.host, addr.port)
 elif isinstance(addr, UNIXAddress):
  res = u'unix:{0}'.format(addr.name)
 elif isinstance(addr, PipeAddress):
  res = u'<pipe>'
 else:
  res = u'?:{0}'.format(addr)
 return res

def peer2str ( addr ) : if isinstance ( addr , IPv4Address ) : res = u'tcp4:{0}:{1}' . format ( addr . host , addr . port ) elif ( _HAS_IPV6 and isinstance ( addr , IPv6Address ) ) : res = u'tcp6:{0}:{1}' . format ( addr . host , addr . port ) elif isinstance ( addr , UNIXAddress ) : res = u'unix:{0}' . format ( addr . name ) elif isinstance ( addr , PipeAddress ) : res = u'<pipe>' else : res = u'?:{0}' . format ( addr ) return res
convert a twisted address as returned from self .