Skip to content

Commit ac0333e

Browse files
Fix all Python Cookbook links (#22205)
1 parent 5a565b3 commit ac0333e

File tree

17 files changed

+20
-20
lines changed

17 files changed

+20
-20
lines changed

Doc/faq/programming.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ How do you remove duplicates from a list?
11411141

11421142
See the Python Cookbook for a long discussion of many ways to do this:
11431143

1144-
https://code.activestate.com/recipes/52560/
1144+
https://github.com/ActiveState/code/tree/master/recipes/Python/52560_Remove_duplicates/recipe-52560.py
11451145

11461146
If you don't mind reordering the list, sort it and then scan from the end of the
11471147
list, deleting duplicates as you go::

Doc/howto/urllib2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,5 +601,5 @@ This document was reviewed and revised by John Lee.
601601
scripts with a localhost server, I have to prevent urllib from using
602602
the proxy.
603603
.. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe
604-
<https://code.activestate.com/recipes/456195/>`_.
604+
<https://github.com/ActiveState/code/tree/master/recipes/Python/456195_urrlib2_opener_SSL_proxy_CONNECT/recipe-456195.py>`_.
605605

Doc/library/bisect.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The following functions are provided:
6060
.. seealso::
6161

6262
`SortedCollection recipe
63-
<https://code.activestate.com/recipes/577197-sortedcollection/>`_ that uses
63+
<https://github.com/ActiveState/code/tree/master/recipes/Python/577197_SortedCollection/recipe-577197.py>`_ that uses
6464
bisect to build a full-featured collection class with straight-forward search
6565
methods and support for a key-function. The keys are precomputed to save
6666
unnecessary calls to the key function during searches.

Doc/library/collections.abc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
308308

309309
.. seealso::
310310

311-
* `OrderedSet recipe <https://code.activestate.com/recipes/576694/>`_ for an
311+
* `OrderedSet recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/576694_OrderedSet/recipe-576694.py>`_ for an
312312
example built on :class:`MutableSet`.
313313

314314
* For more about ABCs, see the :mod:`abc` module and :pep:`3119`.

Doc/library/collections.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ The class can be used to simulate nested scopes and is useful in templating.
135135
:attr:`~collections.ChainMap.parents` property.
136136

137137
* The `Nested Contexts recipe
138-
<https://code.activestate.com/recipes/577434/>`_ has options to control
138+
<https://github.com/ActiveState/code/tree/master/recipes/Python/577434_Nested_contexts__chamapping/recipe-577434.py>`_ has options to control
139139
whether writes and other mutations apply only to the first mapping or to
140140
any mapping in the chain.
141141

142142
* A `greatly simplified read-only version of Chainmap
143-
<https://code.activestate.com/recipes/305268/>`_.
143+
<https://github.com/ActiveState/code/tree/master/recipes/Python/305268_Chained_map_lookups/recipe-305268.py>`_.
144144

145145

146146
:class:`ChainMap` Examples and Recipes

Doc/library/difflib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ If you want to know how to change the first sequence into the second, use
633633
work.
634634

635635
* `Simple version control recipe
636-
<https://code.activestate.com/recipes/576729/>`_ for a small application
636+
<https://github.com/ActiveState/code/tree/master/recipes/Python/576729_Simple_Version_Control/recipe-576729.py>`_ for a small application
637637
built with :class:`SequenceMatcher`.
638638

639639

Doc/library/math.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Number-theoretic and representation functions
123123

124124
For further discussion and two alternative approaches, see the `ASPN cookbook
125125
recipes for accurate floating point summation
126-
<https://code.activestate.com/recipes/393090/>`_\.
126+
<https://github.com/ActiveState/code/tree/master/recipes/Python/393090_Binary_floating_point_summatiaccurate_full/recipe-393090.py>`_\.
127127

128128

129129
.. function:: gcd(*integers)

Doc/library/random.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ from sources provided by the operating system.
5757

5858

5959
`Complementary-Multiply-with-Carry recipe
60-
<https://code.activestate.com/recipes/576707/>`_ for a compatible alternative
60+
<https://github.com/ActiveState/code/tree/master/recipes/Python/576707_Long_period_random_number/recipe-576707.py>`_ for a compatible alternative
6161
random number generator with a long period and comparatively simple update
6262
operations.
6363

Doc/library/shelve.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Two additional methods are supported:
7575

7676
.. seealso::
7777

78-
`Persistent dictionary recipe <https://code.activestate.com/recipes/576642/>`_
78+
`Persistent dictionary recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/576642_Persistent_dict_multiple_standard_file/recipe-576642.py>`_
7979
with widely supported storage formats and having the speed of native
8080
dictionaries.
8181

Doc/library/stdtypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ objects that compare equal might have different :attr:`~range.start`,
14041404

14051405
.. seealso::
14061406

1407-
* The `linspace recipe <http://code.activestate.com/recipes/579000/>`_
1407+
* The `linspace recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/579000_Equallyspaced_numbers_linspace/recipe-579000.py>`_
14081408
shows how to implement a lazy version of range suitable for floating
14091409
point applications.
14101410

Doc/library/sys.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ always available.
679679
additional garbage collector overhead if the object is managed by the garbage
680680
collector.
681681

682-
See `recursive sizeof recipe <https://code.activestate.com/recipes/577504>`_
682+
See `recursive sizeof recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/577504_Compute_Memory_footprint_object_its/recipe-577504.py>`_
683683
for an example of using :func:`getsizeof` recursively to find the size of
684684
containers and all their contents.
685685

Doc/tutorial/whatnow.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ More Python resources:
4343
for download. Once you begin releasing code, you can register it here so that
4444
others can find it.
4545

46-
* https://code.activestate.com/recipes/langs/python/: The Python Cookbook is a
46+
* https://github.com/ActiveState/code/tree/master/recipes/Python: The Python Cookbook is a
4747
sizable collection of code examples, larger modules, and useful scripts.
4848
Particularly notable contributions are collected in a book also titled Python
4949
Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.)

Doc/whatsnew/3.2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,8 @@ functools
781781

782782
(Contributed by Raymond Hettinger and incorporating design ideas from Jim
783783
Baker, Miki Tebeka, and Nick Coghlan; see `recipe 498245
784-
<https://code.activestate.com/recipes/498245>`_\, `recipe 577479
785-
<https://code.activestate.com/recipes/577479>`_\, :issue:`10586`, and
784+
<https://github.com/ActiveState/code/tree/master/recipes/Python/498245_LRU_and_LFU_cache_decorators/recipe-498245.py>`_\, `recipe 577479
785+
<https://github.com/ActiveState/code/tree/master/recipes/Python/577479_Simple_caching_decorator/recipe-577479.py>`_\, :issue:`10586`, and
786786
:issue:`10593`.)
787787

788788
* The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` attribute

Lib/collections/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ class Counter(dict):
574574
# http://en.wikipedia.org/wiki/Multiset
575575
# http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html
576576
# http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm
577-
# http://code.activestate.com/recipes/259174/
577+
# https://github.com/ActiveState/code/tree/master/recipes/Python/259174_bag_collection_class/recipe-259174.py
578578
# Knuth, TAOCP Vol. II section 4.6.3
579579

580580
def __init__(self, iterable=None, /, **kwds):

Lib/heapq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def merge(*iterables, key=None, reverse=False):
456456
# 2) Made multiple passes over the data.
457457
# 3) Made more comparisons in common cases (small k, large n, semi-random input).
458458
# See the more detailed comparison of approach at:
459-
# http://code.activestate.com/recipes/577573-compare-algorithms-for-heapqsmallest
459+
# https://github.com/ActiveState/code/tree/master/recipes/Python/577573_Compare_algorithms/recipe-577573.py
460460

461461
def nsmallest(n, iterable, key=None):
462462
"""Find the n smallest elements in a dataset.

Lib/test/test_math.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def testFsum(self):
611611
def msum(iterable):
612612
"""Full precision summation. Compute sum(iterable) without any
613613
intermediate accumulation of error. Based on the 'lsum' function
614-
at http://code.activestate.com/recipes/393090/
614+
at https://github.com/ActiveState/code/tree/master/recipes/Python/393090_Binary_floating_point_summatiaccurate_full/recipe-393090.py
615615
616616
"""
617617
tmant, texp = 0, 0

Tools/peg_generator/pegen/sccutils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def strongly_connected_components(
1818
exactly once; vertices not part of a SCC are returned as
1919
singleton sets.
2020
21-
From http://code.activestate.com/recipes/578507/.
21+
From https://github.com/ActiveState/code/tree/master/recipes/Python/578507_Strongly_connected_components_directed/recipe-578507.py.
2222
"""
2323
identified: Set[str] = set()
2424
stack: List[str] = []
@@ -81,7 +81,7 @@ def topsort(
8181
{B, C}
8282
{A}
8383
84-
From http://code.activestate.com/recipes/577413/.
84+
From https://github.com/ActiveState/code/tree/master/recipes/Python/577413_Topological_Sort/recipe-577413.py.
8585
"""
8686
# TODO: Use a faster algorithm?
8787
for k, v in data.items():

0 commit comments

Comments
 (0)