Skip to content

Commit 7a169c9

Browse files
committed
Update mentions to RFC 4122 to RFC 4122/9562 when possible.
1 parent a14ae9b commit 7a169c9

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

Doc/library/uuid.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
:mod:`!uuid` --- UUID objects according to :rfc:`4122`
1+
:mod:`!uuid` --- UUID objects according to :rfc:`9562`
22
======================================================
33

44
.. module:: uuid
5-
:synopsis: UUID objects (universally unique identifiers) according to RFC 4122
5+
:synopsis: UUID objects (universally unique identifiers) according to RFC 9562
66
.. moduleauthor:: Ka-Ping Yee <[email protected]>
77
.. sectionauthor:: George Yoshida <[email protected]>
88

@@ -12,7 +12,7 @@
1212

1313
This module provides immutable :class:`UUID` objects (the :class:`UUID` class)
1414
and the functions :func:`uuid1`, :func:`uuid3`, :func:`uuid4`, :func:`uuid5` for
15-
generating version 1, 3, 4, 5, and 8 UUIDs as specified in :rfc:`4122`.
15+
generating version 1, 3, 4, 5, and 8 UUIDs as specified in :rfc:`9562`.
1616

1717
If all you want is a unique ID, you should probably call :func:`uuid1` or
1818
:func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it creates
@@ -65,7 +65,7 @@ which relays any information about the UUID's safety, using this enumeration:
6565

6666
Exactly one of *hex*, *bytes*, *bytes_le*, *fields*, or *int* must be given.
6767
The *version* argument is optional; if given, the resulting UUID will have its
68-
variant and version number set according to :rfc:`4122`, overriding bits in the
68+
variant and version number set according to :rfc:`9562`, overriding bits in the
6969
given *hex*, *bytes*, *bytes_le*, *fields*, or *int*.
7070

7171
Comparison of UUID objects are made by way of comparing their
@@ -137,7 +137,7 @@ which relays any information about the UUID's safety, using this enumeration:
137137

138138
.. attribute:: UUID.urn
139139

140-
The UUID as a URN as specified in :rfc:`4122`.
140+
The UUID as a URN as specified in :rfc:`9562`.
141141

142142

143143
.. attribute:: UUID.variant
@@ -172,7 +172,7 @@ The :mod:`uuid` module defines the following functions:
172172
runs, it may launch a separate program, which could be quite slow. If all
173173
attempts to obtain the hardware address fail, we choose a random 48-bit
174174
number with the multicast bit (least significant bit of the first octet)
175-
set to 1 as recommended in :rfc:`4122`. "Hardware address" means the MAC
175+
set to 1 as recommended in :rfc:`9562`. "Hardware address" means the MAC
176176
address of a network interface. On a machine with multiple network
177177
interfaces, universally administered MAC addresses (i.e. where the second
178178
least significant bit of the first octet is *unset*) will be preferred over
@@ -266,7 +266,9 @@ of the :attr:`~UUID.variant` attribute:
266266

267267
.. data:: RFC_4122
268268

269-
Specifies the UUID layout given in :rfc:`4122`.
269+
Specifies the UUID layout given in :rfc:`4122`. This constant is kept
270+
for backward compatibility even though :rfc:`4122` has been superseeded
271+
by :rfc:`9562`.
270272

271273

272274
.. data:: RESERVED_MICROSOFT
@@ -281,7 +283,7 @@ of the :attr:`~UUID.variant` attribute:
281283

282284
.. seealso::
283285

284-
:rfc:`4122` - A Universally Unique IDentifier (UUID) URN Namespace
286+
:rfc:`9562` - A Universally Unique IDentifier (UUID) URN Namespace
285287
This specification defines a Uniform Resource Name namespace for UUIDs, the
286288
internal format of UUIDs, and methods of generating UUIDs.
287289

Lib/uuid.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
r"""UUID objects (universally unique identifiers) according to RFC 4122.
1+
r"""UUID objects (universally unique identifiers) according to RFC 4122/9562.
22
33
This module provides immutable UUID objects (class UUID) and the functions
44
uuid1(), uuid3(), uuid4(), uuid5(), and uuid8() for generating version 1, 3,
5-
4, 5, and 8 UUIDs as specified in RFC 4122 (superseeded by RFC 9562 but still
6-
referred to as RFC 4122 for compatibility purposes).
5+
4, 5, and 8 UUIDs as specified in RFC 4122/9562.
76
87
If all you want is a unique ID, you should probably call uuid1() or uuid4().
98
Note that uuid1() may compromise privacy since it creates a UUID containing
@@ -125,7 +124,7 @@ class UUID:
125124
126125
int the UUID as a 128-bit integer
127126
128-
urn the UUID as a URN as specified in RFC 4122
127+
urn the UUID as a URN as specified in RFC 4122/9562
129128
130129
variant the UUID variant (one of the constants RESERVED_NCS,
131130
RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE)
@@ -217,7 +216,7 @@ def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
217216
if version is not None:
218217
if not 1 <= version <= 8:
219218
raise ValueError('illegal version number')
220-
# Set the variant to RFC 4122.
219+
# Set the variant to RFC 4122/9562.
221220
int &= ~(0xc000 << 48)
222221
int |= 0x8000 << 48
223222
# Set the version number.
@@ -356,7 +355,7 @@ def variant(self):
356355

357356
@property
358357
def version(self):
359-
# The version bits are only meaningful for RFC 4122 UUIDs.
358+
# The version bits are only meaningful for RFC 4122/9562 UUIDs.
360359
if self.variant == RFC_4122:
361360
return int((self.int >> 76) & 0xf)
362361

0 commit comments

Comments
 (0)