From 70b9acfa20a6f4f8b7392b55fa74f419775ba4e8 Mon Sep 17 00:00:00 2001 From: Bradley Reynolds Date: Tue, 5 Dec 2023 15:40:08 -0600 Subject: [PATCH 1/2] Document sorted(d) --- Doc/library/stdtypes.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index f204b287b565eb..b6f6d4dd005c7a 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -4603,6 +4603,11 @@ can be used interchangeably to index the same dictionary entry. LIFO order is now guaranteed. In prior versions, :meth:`popitem` would return an arbitrary key/value pair. + .. describe:: sorted(d) + + Return a sorted iterator over the keys of the dictionary. This is a + shortcut for ``sorted(d.keys())``. + .. describe:: reversed(d) Return a reverse iterator over the keys of the dictionary. This is a From 5be14a8d076b86ccdb97c1f959319e41f5ebf44e Mon Sep 17 00:00:00 2001 From: Bradley Reynolds Date: Tue, 5 Dec 2023 16:09:25 -0600 Subject: [PATCH 2/2] Remove trailing space --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index b6f6d4dd005c7a..df41cbe9c43f82 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -4605,7 +4605,7 @@ can be used interchangeably to index the same dictionary entry. .. describe:: sorted(d) - Return a sorted iterator over the keys of the dictionary. This is a + Return a sorted iterator over the keys of the dictionary. This is a shortcut for ``sorted(d.keys())``. .. describe:: reversed(d)