mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Issue #26267: Improve uuid.UUID documentation
* Document how comparison of UUID objects work * Document str(uuid) returns the braceless standard form * Add a test for comparison of a UUID object with a non-UUID object Patch by Ammar Askar.
This commit is contained in:
parent
195319e6bb
commit
6b5e4a86a7
2 changed files with 11 additions and 0 deletions
|
@ -45,6 +45,13 @@ random UUID.
|
|||
variant and version number set according to RFC 4122, overriding bits in the
|
||||
given *hex*, *bytes*, *bytes_le*, *fields*, or *int*.
|
||||
|
||||
Comparison of UUID objects are made by way of comparing their
|
||||
:attr:`UUID.int` attributes. Comparison with a non-UUID object
|
||||
raises a :exc:`TypeError`.
|
||||
|
||||
``str(uuid)`` returns a string in the form
|
||||
``12345678-1234-5678-1234-567812345678`` where the 32 hexadecimal digits
|
||||
represent the UUID.
|
||||
|
||||
:class:`UUID` instances have these read-only attributes:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue