From a69f72ba62e9f502716ed7e70ff8c18424fbb5ab Mon Sep 17 00:00:00 2001 From: farisbasha Date: Tue, 17 Nov 2026 23:10:08 +0530 Subject: [PATCH 1/3] gh-103484: Fix dead links to David Beazley's generator tutorials The coroutines/index.html and generators/ pages on dabeaz.com now return 404. Link to the matching entries on the tutorials page instead. --- Doc/library/unittest.mock-examples.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst index da57f05edcf78f..92c92c383dad5b 100644 --- a/Doc/library/unittest.mock-examples.rst +++ b/Doc/library/unittest.mock-examples.rst @@ -672,10 +672,11 @@ To configure the values returned from the iteration (implicit in the call to [1, 2, 3] .. [#] There are also generator expressions and more `advanced uses - `_ of generators, but we aren't - concerned about them here. A very good introduction to generators and how - powerful they are is: `Generator Tricks for Systems Programmers - `_. + `_ of + generators, but we aren't concerned about them here. A very good + introduction to generators and how powerful they are is: `Generator Tricks + for Systems Programmers + `_. Applying the same patch to every test method From 5e227c10782a66d811a12ee6d11a021cafbeaef7 Mon Sep 17 00:00:00 2001 From: farisbasha Date: Wed, 18 Nov 2026 09:17:38 +0530 Subject: [PATCH 2/3] Drop the generator tutorials footnote --- Doc/library/unittest.mock-examples.rst | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst index 92c92c383dad5b..afa8985d526f49 100644 --- a/Doc/library/unittest.mock-examples.rst +++ b/Doc/library/unittest.mock-examples.rst @@ -642,7 +642,7 @@ Mocking a generator method ~~~~~~~~~~~~~~~~~~~~~~~~~~ A Python generator is a function or method that uses the :keyword:`yield` statement -to return a series of values when iterated over [#]_. +to return a series of values when iterated over. A generator method / function is called to return the generator object. It is the generator object that is then iterated over. The protocol method for @@ -671,14 +671,6 @@ To configure the values returned from the iteration (implicit in the call to >>> list(mock_foo.iter()) [1, 2, 3] -.. [#] There are also generator expressions and more `advanced uses - `_ of - generators, but we aren't concerned about them here. A very good - introduction to generators and how powerful they are is: `Generator Tricks - for Systems Programmers - `_. - - Applying the same patch to every test method ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From bc8ab919e6691b905008bc85c4d0d11f1f5bb485 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 18 Nov 2026 08:50:15 +0000 Subject: [PATCH 3/3] Add back line --- Doc/library/unittest.mock-examples.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst index afa8985d526f49..7b736b5aecb641 100644 --- a/Doc/library/unittest.mock-examples.rst +++ b/Doc/library/unittest.mock-examples.rst @@ -671,6 +671,7 @@ To configure the values returned from the iteration (implicit in the call to >>> list(mock_foo.iter()) [1, 2, 3] + Applying the same patch to every test method ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~