-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-128427: Add uuid.NIL
and uuid.MAX
#128429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
50c6294
fc14200
8b71df2
2fde894
ecf263a
cba80bc
bf61ffe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -289,6 +289,25 @@ of the :attr:`~UUID.variant` attribute: | |||||
Reserved for future definition. | ||||||
|
||||||
|
||||||
The :mod:`uuid` module defines the special Nil and Max UUID values: | ||||||
|
||||||
|
||||||
.. data:: NIL | ||||||
|
||||||
A special form of UUID that is specified to have all 128 bits set to zero | ||||||
according to :rfc:`RFC 9562, §5.9 <9562#section-5.9>`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Linking directly to the section is helpful, perhaps we only need to mention the RFC number here? If so, we could update the same thing for
Suggested change
|
||||||
|
||||||
.. versionadded:: next | ||||||
|
||||||
|
||||||
.. data:: MAX | ||||||
|
||||||
A special form of UUID that is specified to have all 128 bits set to one | ||||||
according to :rfc:`RFC 9562, §5.10 <9562#section-5.10>`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
.. versionadded:: next | ||||||
|
||||||
|
||||||
.. seealso:: | ||||||
|
||||||
:rfc:`9562` - A Universally Unique IDentifier (UUID) URN Namespace | ||||||
|
@@ -380,6 +399,14 @@ Here are some examples of typical usage of the :mod:`uuid` module:: | |||||
>>> uuid.UUID(bytes=x.bytes) | ||||||
UUID('00010203-0405-0607-0809-0a0b0c0d0e0f') | ||||||
|
||||||
>>> # get the Nil UUID | ||||||
>>> uuid.NIL | ||||||
UUID('00000000-0000-0000-0000-000000000000') | ||||||
|
||||||
>>> # get the Max UUID | ||||||
>>> uuid.MAX | ||||||
UUID('ffffffff-ffff-ffff-ffff-ffffffffffff') | ||||||
ngnpope marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
|
||||||
.. _uuid-cli-example: | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
:const:`uuid.NIL` and :const:`uuid.MAX` are now available to represent the Nil | ||
and Max UUID formats as defined by :rfc:`9562`. |
Uh oh!
There was an error while loading. Please reload this page.