--- a/Doc/library/uuid.rst Tue Jul 05 17:08:52 2016 +0300 +++ b/Doc/library/uuid.rst Wed Jul 06 14:46:56 2016 -0700 @@ -46,72 +46,87 @@ given *hex*, *bytes*, *bytes_le*, *fields*, or *int*. -:class:`UUID` instances have these read-only attributes: + :class:`UUID` instances support the following operations: -.. attribute:: UUID.bytes + .. describe:: str(uuid) - The UUID as a 16-byte string (containing the six integer fields in big-endian - byte order). + Returns a string in the form ``12345678-1234-5678-1234-567812345678`` + where the 32 hexcadecimal digits represent the UUID + .. describe:: uuid1 == uuid2 + .. describe:: uuid1 < uuid2 + .. describe:: uuid1 > uuid2 -.. attribute:: UUID.bytes_le + Compares two UUID instances by way of comparing their :attr:`UUID.int` + attributes - The UUID as a 16-byte string (with *time_low*, *time_mid*, and *time_hi_version* - in little-endian byte order). + :class:`UUID` instances have these read-only attributes: -.. attribute:: UUID.fields + .. attribute:: UUID.bytes - A tuple of the six integer fields of the UUID, which are also available as six - individual attributes and two derived attributes: + The UUID as a 16-byte string (containing the six integer fields in big-endian + byte order). - +------------------------------+-------------------------------+ - | Field | Meaning | - +==============================+===============================+ - | :attr:`time_low` | the first 32 bits of the UUID | - +------------------------------+-------------------------------+ - | :attr:`time_mid` | the next 16 bits of the UUID | - +------------------------------+-------------------------------+ - | :attr:`time_hi_version` | the next 16 bits of the UUID | - +------------------------------+-------------------------------+ - | :attr:`clock_seq_hi_variant` | the next 8 bits of the UUID | - +------------------------------+-------------------------------+ - | :attr:`clock_seq_low` | the next 8 bits of the UUID | - +------------------------------+-------------------------------+ - | :attr:`node` | the last 48 bits of the UUID | - +------------------------------+-------------------------------+ - | :attr:`time` | the 60-bit timestamp | - +------------------------------+-------------------------------+ - | :attr:`clock_seq` | the 14-bit sequence number | - +------------------------------+-------------------------------+ + .. attribute:: UUID.bytes_le -.. attribute:: UUID.hex + The UUID as a 16-byte string (with *time_low*, *time_mid*, and *time_hi_version* + in little-endian byte order). - The UUID as a 32-character hexadecimal string. + .. attribute:: UUID.fields -.. attribute:: UUID.int + A tuple of the six integer fields of the UUID, which are also available as six + individual attributes and two derived attributes: - The UUID as a 128-bit integer. + +------------------------------+-------------------------------+ + | Field | Meaning | + +==============================+===============================+ + | :attr:`time_low` | the first 32 bits of the UUID | + +------------------------------+-------------------------------+ + | :attr:`time_mid` | the next 16 bits of the UUID | + +------------------------------+-------------------------------+ + | :attr:`time_hi_version` | the next 16 bits of the UUID | + +------------------------------+-------------------------------+ + | :attr:`clock_seq_hi_variant` | the next 8 bits of the UUID | + +------------------------------+-------------------------------+ + | :attr:`clock_seq_low` | the next 8 bits of the UUID | + +------------------------------+-------------------------------+ + | :attr:`node` | the last 48 bits of the UUID | + +------------------------------+-------------------------------+ + | :attr:`time` | the 60-bit timestamp | + +------------------------------+-------------------------------+ + | :attr:`clock_seq` | the 14-bit sequence number | + +------------------------------+-------------------------------+ -.. attribute:: UUID.urn + .. attribute:: UUID.hex - The UUID as a URN as specified in RFC 4122. + The UUID as a 32-character hexadecimal string. -.. attribute:: UUID.variant + .. attribute:: UUID.int - The UUID variant, which determines the internal layout of the UUID. This will be - one of the integer constants :const:`RESERVED_NCS`, :const:`RFC_4122`, - :const:`RESERVED_MICROSOFT`, or :const:`RESERVED_FUTURE`. + The UUID as a 128-bit integer. -.. attribute:: UUID.version + .. attribute:: UUID.urn - The UUID version number (1 through 5, meaningful only when the variant is - :const:`RFC_4122`). + The UUID as a URN as specified in RFC 4122. + + + .. attribute:: UUID.variant + + The UUID variant, which determines the internal layout of the UUID. This will be + one of the integer constants :const:`RESERVED_NCS`, :const:`RFC_4122`, + :const:`RESERVED_MICROSOFT`, or :const:`RESERVED_FUTURE`. + + + .. attribute:: UUID.version + + The UUID version number (1 through 5, meaningful only when the variant is + :const:`RFC_4122`). The :mod:`uuid` module defines the following functions: