From a56f6bbae0e2e0c4c580aabd68bd3657ba872ad2 Mon Sep 17 00:00:00 2001 From: talosgl_wsl <68163715+talosgl@users.noreply.github.com> Date: Sat, 14 Jun 2025 11:31:22 -0700 Subject: [PATCH 1/2] Clarify wording in chapter 10 so it does not imply a new list is created when using t.sort() --- book3/10-tuples.mkd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book3/10-tuples.mkd b/book3/10-tuples.mkd index 680ff456..1a2a377d 100644 --- a/book3/10-tuples.mkd +++ b/book3/10-tuples.mkd @@ -358,7 +358,7 @@ key: [('a', 10), ('b', 1), ('c', 22)] ~~~~ -The new list is sorted in ascending alphabetical order by the key value. +The list of tuples is now sorted in ascending alphabetical order by the key. Multiple assignment with dictionaries ------------------------------------- @@ -403,7 +403,7 @@ To do this, we first make a list of tuples where each tuple is list of `(key, value)` tuples, but this time we want to sort by value, not key. Once we have constructed the list with the value-key tuples, it is a simple matter to sort the list in reverse order and -print out the new, sorted list. +print it out. ~~~~ {.python} >>> d = {'a':10, 'b':1, 'c':22} @@ -420,7 +420,7 @@ print out the new, sorted list. ~~~~ By carefully constructing the list of tuples to have the value as the -first element of each tuple, we can sort the list of tuples and get our +first element of each tuple, we can sort the list of tuples and print our dictionary contents sorted by value. The most common words From 58d18e803d3d28886011264de1251dd9cbd40ef5 Mon Sep 17 00:00:00 2001 From: talosgl_wsl <68163715+talosgl@users.noreply.github.com> Date: Sat, 14 Jun 2025 11:32:13 -0700 Subject: [PATCH 2/2] Update text to explicitly reference urllib as the HTTP protocol support library so reader does not confuse socket library from this section for that. --- book3/12-network.mkd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book3/12-network.mkd b/book3/12-network.mkd index 1ae048d5..5756e5c2 100644 --- a/book3/12-network.mkd +++ b/book3/12-network.mkd @@ -119,7 +119,8 @@ send and receive the data according to the protocol. However, since the protocol that we use most commonly is the HTTP web protocol, Python has a special library specifically designed to support -the HTTP protocol for the retrieval of documents and data over the web. +the HTTP protocol for the retrieval of documents and data over the web, +`urllib`, which we'll cover shortly. One of the requirements for using the HTTP protocol is the need to send and receive data as bytes objects, instead of strings. In the preceding