We're mixing two different formatting techniques in Python here:
def __str__(self): return "0x%02X".format(self.byte)