From e7451b8262abd345ed2d4d2f4c88b27fecd9687a Mon Sep 17 00:00:00 2001 From: oda-gitso Date: Sat, 18 Feb 2023 18:47:08 +0700 Subject: [PATCH 1/2] fix-101777 --- Doc/library/queue.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index c67f15e953bccc..b8b48412dde743 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -57,8 +57,8 @@ The :mod:`queue` module defines the following classes and exceptions: *maxsize* is less than or equal to zero, the queue size is infinite. The lowest valued entries are retrieved first (the lowest valued entry is the - one returned by ``sorted(list(entries))[0]``). A typical pattern for entries - is a tuple in the form: ``(priority_number, data)``. + one that would be returned by ``sorted(list(entries))[0]``). A typical + pattern for entries is a tuple in the form: ``(priority_number, data)``. If the *data* elements are not comparable, the data can be wrapped in a class that ignores the data item and only compares the priority number:: From bc40a6aceeeb86a87cdf88e42df3de14e325e0f9 Mon Sep 17 00:00:00 2001 From: Owain Davies Date: Mon, 20 Feb 2023 23:34:43 +0700 Subject: [PATCH 2/2] Use min(entries) rather than sorted(list(entries))[0] --- Doc/library/queue.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index b8b48412dde743..46b8e9b18a3c1f 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -57,8 +57,8 @@ The :mod:`queue` module defines the following classes and exceptions: *maxsize* is less than or equal to zero, the queue size is infinite. The lowest valued entries are retrieved first (the lowest valued entry is the - one that would be returned by ``sorted(list(entries))[0]``). A typical - pattern for entries is a tuple in the form: ``(priority_number, data)``. + one that would be returned by ``min(entries)``). A typical pattern for + entries is a tuple in the form: ``(priority_number, data)``. If the *data* elements are not comparable, the data can be wrapped in a class that ignores the data item and only compares the priority number::