From 4901bf64880980d849d3c998f8faca060a932edc Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Sat, 16 Aug 2025 17:13:19 +0800 Subject: [PATCH 1/6] Update uuid.rst --- Doc/library/uuid.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Doc/library/uuid.rst b/Doc/library/uuid.rst index 6698e6d3f43c43..fcdbc21de3825f 100644 --- a/Doc/library/uuid.rst +++ b/Doc/library/uuid.rst @@ -449,15 +449,24 @@ Here are some examples of typical usage of the :mod:`uuid` module:: >>> uuid.MAX UUID('ffffffff-ffff-ffff-ffff-ffffffffffff') + >>> # make a UUID based on the host ID and current time + >>> # reordered for improved DB locality + >>> uuid.uuid6() + UUID('1f0799c0-98b9-62db-92c6-a0d365b91053') + >>> # get UUIDv7 creation (local) time as a timestamp in milliseconds >>> u = uuid.uuid7() >>> u.time # doctest: +SKIP 1743936859822 + >>> # get UUIDv7 creation (local) time as a datetime object >>> import datetime as dt >>> dt.datetime.fromtimestamp(u.time / 1000) # doctest: +SKIP datetime.datetime(...) + >>> # make a UUID using three customizable fields + >>> uuid.uuid8(0x12345678, 0x9abcdef0, 0x11223344) + UUID('00001234-5678-8ef0-8000-000011223344') .. _uuid-cli-example: From 46fbf8787182b113be1b52d400650be2a3c44c9b Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Sat, 16 Aug 2025 23:34:17 +0800 Subject: [PATCH 2/6] add blank line --- Doc/library/uuid.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/uuid.rst b/Doc/library/uuid.rst index fcdbc21de3825f..a0e866c4157d25 100644 --- a/Doc/library/uuid.rst +++ b/Doc/library/uuid.rst @@ -468,6 +468,7 @@ Here are some examples of typical usage of the :mod:`uuid` module:: >>> uuid.uuid8(0x12345678, 0x9abcdef0, 0x11223344) UUID('00001234-5678-8ef0-8000-000011223344') + .. _uuid-cli-example: Command-Line Example From fec716cf2554c6f4b3ff374aec5dd3943a4daeff Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Mon, 18 Aug 2025 18:56:00 +0800 Subject: [PATCH 3/6] Update Doc/library/uuid.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- Doc/library/uuid.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Doc/library/uuid.rst b/Doc/library/uuid.rst index a0e866c4157d25..6f93da355ec720 100644 --- a/Doc/library/uuid.rst +++ b/Doc/library/uuid.rst @@ -449,8 +449,7 @@ Here are some examples of typical usage of the :mod:`uuid` module:: >>> uuid.MAX UUID('ffffffff-ffff-ffff-ffff-ffffffffffff') - >>> # make a UUID based on the host ID and current time - >>> # reordered for improved DB locality + >>> # same as UUIDv1 but with fields reordered to improve DB locality >>> uuid.uuid6() UUID('1f0799c0-98b9-62db-92c6-a0d365b91053') From 585b0a1557187cd308ed55a39c9d9d74f0efac2e Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Mon, 18 Aug 2025 18:56:11 +0800 Subject: [PATCH 4/6] Update Doc/library/uuid.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- Doc/library/uuid.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/uuid.rst b/Doc/library/uuid.rst index 6f93da355ec720..02baf1137daba6 100644 --- a/Doc/library/uuid.rst +++ b/Doc/library/uuid.rst @@ -463,7 +463,7 @@ Here are some examples of typical usage of the :mod:`uuid` module:: >>> dt.datetime.fromtimestamp(u.time / 1000) # doctest: +SKIP datetime.datetime(...) - >>> # make a UUID using three customizable fields + >>> # make a UUID with custom blocks >>> uuid.uuid8(0x12345678, 0x9abcdef0, 0x11223344) UUID('00001234-5678-8ef0-8000-000011223344') From 7e7dc55087faa56e9a169e684b3a9392ebed918a Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Mon, 18 Aug 2025 19:18:11 +0800 Subject: [PATCH 5/6] Update uuid.rst --- Doc/library/uuid.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/uuid.rst b/Doc/library/uuid.rst index 02baf1137daba6..49f53d22853a6c 100644 --- a/Doc/library/uuid.rst +++ b/Doc/library/uuid.rst @@ -411,7 +411,7 @@ Here are some examples of typical usage of the :mod:`uuid` module:: >>> import uuid >>> # make a UUID based on the host ID and current time - >>> uuid.uuid1() + >>> uuid.uuid1() # doctest: +SKIP UUID('a8098c1a-f86e-11da-bd1a-00112444be1e') >>> # make a UUID using an MD5 hash of a namespace UUID and a name From f7b783403ca8dcaeeabb44da6e8e29caf88834dc Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Mon, 18 Aug 2025 19:18:25 +0800 Subject: [PATCH 6/6] Update Doc/library/uuid.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- Doc/library/uuid.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/uuid.rst b/Doc/library/uuid.rst index 49f53d22853a6c..aa4f1bf940bc5c 100644 --- a/Doc/library/uuid.rst +++ b/Doc/library/uuid.rst @@ -450,7 +450,7 @@ Here are some examples of typical usage of the :mod:`uuid` module:: UUID('ffffffff-ffff-ffff-ffff-ffffffffffff') >>> # same as UUIDv1 but with fields reordered to improve DB locality - >>> uuid.uuid6() + >>> uuid.uuid6() # doctest: +SKIP UUID('1f0799c0-98b9-62db-92c6-a0d365b91053') >>> # get UUIDv7 creation (local) time as a timestamp in milliseconds