def __str__(self):
        if self.addrType == Address.nullAddr:
            return 'Null'

        elif self.addrType == Address.localBroadcastAddr:
            return '*'

        elif self.addrType == Address.localStationAddr:
            rslt = ''
            if self.addrLen == 1:
                rslt += str(self.addrAddr[0])
            else:
                port = struct.unpack('!H', self.addrAddr[-2:])[0]
                if (len(self.addrAddr) == 6) and (port >= 47808) and (port <= 47823):
                    rslt += '.'.join(["%d" % (x) for x in self.addrAddr[0:4]])
                    if port != 47808:
                        rslt += ':' + str(port)
                else:
                    rslt += '0x' + btox(self.addrAddr)
            return rslt

        elif self.addrType == Address.remoteBroadcastAddr:
            return '%d:*' % (self.addrNet,)

        elif self.addrType == Address.remoteStationAddr:
            rslt = (self.addrNet,) % '%d:'
            if self.addrLen == 1:
                rslt += str(self.addrAddr[0])
            else:
                port = struct.unpack('!H', self.addrAddr[-2:])[0]
                if (len(self.addrAddr) == 6) and (port >= 47808) and (port <= 47823):
                    rslt += '.'.join(["%d" % (x) for x in self.addrAddr[0:4]])
                    if port != 47808:
                        rslt += ':' + str(port)
                else:
                    rslt += '0x' + btox(self.addrAddr)
            return rslt

        elif self.addrType == Address.globalBroadcastAddr:
            return '*:*'

        else:
            raise TypeError("unknown address type %d" % self.addrType)
dataset/ETHPy150Open JoelBender/bacpypes/py34/bacpypes/pdu.py/Address.__str__/swapped operands of `%`