]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix all Python Cookbook links (#22205)
authorAndre Delfino <adelfino@gmail.com>
Tue, 15 Sep 2020 20:13:26 +0000 (17:13 -0300)
committerGitHub <noreply@github.com>
Tue, 15 Sep 2020 20:13:26 +0000 (21:13 +0100)
17 files changed:
Doc/faq/programming.rst
Doc/howto/urllib2.rst
Doc/library/bisect.rst
Doc/library/collections.abc.rst
Doc/library/collections.rst
Doc/library/difflib.rst
Doc/library/math.rst
Doc/library/random.rst
Doc/library/shelve.rst
Doc/library/stdtypes.rst
Doc/library/sys.rst
Doc/tutorial/whatnow.rst
Doc/whatsnew/3.2.rst
Lib/collections/__init__.py
Lib/heapq.py
Lib/test/test_math.py
Tools/peg_generator/pegen/sccutils.py

index 66d210a55fac7e9f06a83c6771dd20a8ab0ccd61..eecbbf4a5c4ff72f4d3e92e4337c394102df35df 100644 (file)
@@ -1141,7 +1141,7 @@ How do you remove duplicates from a list?
 
 See the Python Cookbook for a long discussion of many ways to do this:
 
-   https://code.activestate.com/recipes/52560/
+   https://github.com/ActiveState/code/tree/master/recipes/Python/52560_Remove_duplicates/recipe-52560.py
 
 If you don't mind reordering the list, sort it and then scan from the end of the
 list, deleting duplicates as you go::
index 046a88af62f0b3e31ddb2ce9cfc69642cc9cf366..38623371fbabff52248d1d1df0b979aced3fd20b 100644 (file)
@@ -601,5 +601,5 @@ This document was reviewed and revised by John Lee.
        scripts with a localhost server, I have to prevent urllib from using
        the proxy.
 .. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe
-       <https://code.activestate.com/recipes/456195/>`_.
+       <https://github.com/ActiveState/code/tree/master/recipes/Python/456195_urrlib2_opener_SSL_proxy_CONNECT/recipe-456195.py>`_.
 
index 6bf7814b257f4abdbe48b48614635313fdbb07d7..6666d55abe2e503753f2a0279e183516c62d817b 100644 (file)
@@ -60,7 +60,7 @@ The following functions are provided:
 .. seealso::
 
    `SortedCollection recipe
-   <https://code.activestate.com/recipes/577197-sortedcollection/>`_ that uses
+   <https://github.com/ActiveState/code/tree/master/recipes/Python/577197_SortedCollection/recipe-577197.py>`_ that uses
    bisect to build a full-featured collection class with straight-forward search
    methods and support for a key-function.  The keys are precomputed to save
    unnecessary calls to the key function during searches.
index db0e25bb0772eb21e3f939d0e15d4042ab681362..a6038098675da210eb4ea98edd5d5b9f750132c8 100644 (file)
@@ -308,7 +308,7 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
 
 .. seealso::
 
-   * `OrderedSet recipe <https://code.activestate.com/recipes/576694/>`_ for an
+   * `OrderedSet recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/576694_OrderedSet/recipe-576694.py>`_ for an
      example built on :class:`MutableSet`.
 
    * For more about ABCs, see the :mod:`abc` module and :pep:`3119`.
index f538da5e1c9faafb79beed073bfc915abc039b87..a7d01b3f397a70fa5af82fc1bf768f699fb3e967 100644 (file)
@@ -135,12 +135,12 @@ The class can be used to simulate nested scopes and is useful in templating.
       :attr:`~collections.ChainMap.parents` property.
 
     * The `Nested Contexts recipe
-      <https://code.activestate.com/recipes/577434/>`_ has options to control
+      <https://github.com/ActiveState/code/tree/master/recipes/Python/577434_Nested_contexts__chamapping/recipe-577434.py>`_ has options to control
       whether writes and other mutations apply only to the first mapping or to
       any mapping in the chain.
 
     * A `greatly simplified read-only version of Chainmap
-      <https://code.activestate.com/recipes/305268/>`_.
+      <https://github.com/ActiveState/code/tree/master/recipes/Python/305268_Chained_map_lookups/recipe-305268.py>`_.
 
 
 :class:`ChainMap` Examples and Recipes
index aa08988c8b36f71e574a4909dff4a7c74190e29f..009b7976dff15fe183a6dfe2c25296424e3ade76 100644 (file)
@@ -633,7 +633,7 @@ If you want to know how to change the first sequence into the second, use
      work.
 
    * `Simple version control recipe
-     <https://code.activestate.com/recipes/576729/>`_ for a small application
+     <https://github.com/ActiveState/code/tree/master/recipes/Python/576729_Simple_Version_Control/recipe-576729.py>`_ for a small application
      built with :class:`SequenceMatcher`.
 
 
index bbf64643ff59fc7af51a233748f1f7cc5f7b1d76..f152c45a87aa378ece323df7f7613957d2e87f30 100644 (file)
@@ -123,7 +123,7 @@ Number-theoretic and representation functions
 
    For further discussion and two alternative approaches, see the `ASPN cookbook
    recipes for accurate floating point summation
-   <https://code.activestate.com/recipes/393090/>`_\.
+   <https://github.com/ActiveState/code/tree/master/recipes/Python/393090_Binary_floating_point_summatiaccurate_full/recipe-393090.py>`_\.
 
 
 .. function:: gcd(*integers)
index 0cdf0a6ac4a477ed14a59190bbcc57f842b0d888..4e97b1dbad85c1ff58027db0334cada432aa9092 100644 (file)
@@ -57,7 +57,7 @@ from sources provided by the operating system.
 
 
    `Complementary-Multiply-with-Carry recipe
-   <https://code.activestate.com/recipes/576707/>`_ for a compatible alternative
+   <https://github.com/ActiveState/code/tree/master/recipes/Python/576707_Long_period_random_number/recipe-576707.py>`_ for a compatible alternative
    random number generator with a long period and comparatively simple update
    operations.
 
index f08c58179a2f9f071371b4e7bf8217bc47f569ef..a94255bbf698e9e450cbf17e1957c6787c5a3410 100644 (file)
@@ -75,7 +75,7 @@ Two additional methods are supported:
 
 .. seealso::
 
-   `Persistent dictionary recipe <https://code.activestate.com/recipes/576642/>`_
+   `Persistent dictionary recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/576642_Persistent_dict_multiple_standard_file/recipe-576642.py>`_
    with widely supported storage formats and having the speed of native
    dictionaries.
 
index 0ffe7b7526fa768722cfeb591c2e9bf1dd7361d7..2eee22c79af76916bb3c7960530098c55bfae3b8 100644 (file)
@@ -1404,7 +1404,7 @@ objects that compare equal might have different :attr:`~range.start`,
 
 .. seealso::
 
-   * The `linspace recipe <http://code.activestate.com/recipes/579000/>`_
+   * The `linspace recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/579000_Equallyspaced_numbers_linspace/recipe-579000.py>`_
      shows how to implement a lazy version of range suitable for floating
      point applications.
 
index d201d7061f980156b4c1b1bb6c99b54cd3ad4cf9..aa417ede4022863061f9b959e841916a95bae857 100644 (file)
@@ -679,7 +679,7 @@ always available.
    additional garbage collector overhead if the object is managed by the garbage
    collector.
 
-   See `recursive sizeof recipe <https://code.activestate.com/recipes/577504>`_
+   See `recursive sizeof recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/577504_Compute_Memory_footprint_object_its/recipe-577504.py>`_
    for an example of using :func:`getsizeof` recursively to find the size of
    containers and all their contents.
 
index 3208201312b8710a791f1207c5fc36322a612888..38ce9f0a900c283d486b30c7050de07ad25df12a 100644 (file)
@@ -43,7 +43,7 @@ More Python resources:
   for download.  Once you begin releasing code, you can register it here so that
   others can find it.
 
-* https://code.activestate.com/recipes/langs/python/: The Python Cookbook is a
+* https://github.com/ActiveState/code/tree/master/recipes/Python: The Python Cookbook is a
   sizable collection of code examples, larger modules, and useful scripts.
   Particularly notable contributions are collected in a book also titled Python
   Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.)
index 06bee9966c0be24213cb4bb5dec9ca7044cd43aa..37bae34ce74adcbe34e8b322ccdcba9f26cb79b7 100644 (file)
@@ -781,8 +781,8 @@ functools
 
   (Contributed by Raymond Hettinger and incorporating design ideas from Jim
   Baker, Miki Tebeka, and Nick Coghlan; see `recipe 498245
-  <https://code.activestate.com/recipes/498245>`_\, `recipe 577479
-  <https://code.activestate.com/recipes/577479>`_\, :issue:`10586`, and
+  <https://github.com/ActiveState/code/tree/master/recipes/Python/498245_LRU_and_LFU_cache_decorators/recipe-498245.py>`_\, `recipe 577479
+  <https://github.com/ActiveState/code/tree/master/recipes/Python/577479_Simple_caching_decorator/recipe-577479.py>`_\, :issue:`10586`, and
   :issue:`10593`.)
 
 * The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` attribute
index 5d75501645fc4a7ec8e7c0cdadea7a8a0f9bd12f..f4da9d0cefd6bf6be93a2631bbb5b92274f4eda2 100644 (file)
@@ -574,7 +574,7 @@ class Counter(dict):
     #   http://en.wikipedia.org/wiki/Multiset
     #   http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html
     #   http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm
-    #   http://code.activestate.com/recipes/259174/
+    #   https://github.com/ActiveState/code/tree/master/recipes/Python/259174_bag_collection_class/recipe-259174.py
     #   Knuth, TAOCP Vol. II section 4.6.3
 
     def __init__(self, iterable=None, /, **kwds):
index fabefd87f8bf8c804e8eb3155c1aacbf05dd02bd..5895562db4142bca2582261e6436340e80d777c2 100644 (file)
@@ -456,7 +456,7 @@ def merge(*iterables, key=None, reverse=False):
 # 2) Made multiple passes over the data.
 # 3) Made more comparisons in common cases (small k, large n, semi-random input).
 # See the more detailed comparison of approach at:
-# http://code.activestate.com/recipes/577573-compare-algorithms-for-heapqsmallest
+# https://github.com/ActiveState/code/tree/master/recipes/Python/577573_Compare_algorithms/recipe-577573.py
 
 def nsmallest(n, iterable, key=None):
     """Find the n smallest elements in a dataset.
index 4d62eb1b119930dec7147424a8cccee0c7a44df2..f5283c5e0dcb63519e600b0dfdaa18c6e44d0fa2 100644 (file)
@@ -611,7 +611,7 @@ class MathTests(unittest.TestCase):
         def msum(iterable):
             """Full precision summation.  Compute sum(iterable) without any
             intermediate accumulation of error.  Based on the 'lsum' function
-            at http://code.activestate.com/recipes/393090/
+            at https://github.com/ActiveState/code/tree/master/recipes/Python/393090_Binary_floating_point_summatiaccurate_full/recipe-393090.py
 
             """
             tmant, texp = 0, 0
index 1f0586bb2f7d6dbd895e87c590990660deaf941c..0c295196607ec8b04ccbf55db9935b13821175e8 100644 (file)
@@ -18,7 +18,7 @@ def strongly_connected_components(
       exactly once; vertices not part of a SCC are returned as
       singleton sets.
 
-    From http://code.activestate.com/recipes/578507/.
+    From https://github.com/ActiveState/code/tree/master/recipes/Python/578507_Strongly_connected_components_directed/recipe-578507.py.
     """
     identified: Set[str] = set()
     stack: List[str] = []
@@ -81,7 +81,7 @@ def topsort(
         {B, C}
         {A}
 
-    From http://code.activestate.com/recipes/577413/.
+    From https://github.com/ActiveState/code/tree/master/recipes/Python/577413_Topological_Sort/recipe-577413.py.
     """
     # TODO: Use a faster algorithm?
     for k, v in data.items():