diff -r a2d01ed713cb Lib/uuid.py --- a/Lib/uuid.py Sun Aug 03 15:27:18 2014 -0400 +++ b/Lib/uuid.py Sun Aug 03 14:35:01 2014 -0700 @@ -43,6 +43,7 @@ >>> uuid.UUID(bytes=x.bytes) UUID('00010203-0405-0607-0809-0a0b0c0d0e0f') """ +from binascii import unhexlify __author__ = 'Ka-Ping Yee ' @@ -234,10 +235,7 @@ @property def bytes(self): - bytes = bytearray() - for shift in range(0, 128, 8): - bytes.insert(0, (self.int >> shift) & 0xff) - return bytes_(bytes) + return unhexlify(self.hex) @property def bytes_le(self):