Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 728e4de

Browse files
committed
Fix external links to docs.python.org to use internal links instead.
1 parent 5e722f6 commit 728e4de

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

Doc/howto/pyporting.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ The Short Version
3939

4040
With that done, your options are:
4141

42-
* If you are dropping Python 2 support, use 2to3_ to port to Python 3
42+
* If you are dropping Python 2 support, use :ref:`2to3 <2to3-reference>` to port
43+
to Python 3
44+
4345
* If you are keeping Python 2 support, then start writing Python 2/3-compatible
4446
code starting **TODAY**
4547

@@ -601,8 +603,6 @@ If you feel there is something missing from this document that should be added,
601603
please email the python-porting_ mailing list.
602604

603605

604-
605-
.. _2to3: https://docs.python.org/2/library/2to3.html
606606
.. _3to2: https://pypi.python.org/pypi/3to2
607607
.. _Cheeseshop: PyPI_
608608
.. _coverage: https://pypi.python.org/pypi/coverage

Doc/library/unittest.mock-examples.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,8 @@ this list of calls for us:
512512
Partial mocking
513513
~~~~~~~~~~~~~~~
514514

515-
In some tests I wanted to mock out a call to `datetime.date.today()
516-
<https://docs.python.org/library/datetime.html#datetime.date.today>`_ to return
517-
a known date, but I didn't want to prevent the code under test from
515+
In some tests I wanted to mock out a call to :func:`datetime.date.today`
516+
to return a known date, but I didn't want to prevent the code under test from
518517
creating new date objects. Unfortunately `datetime.date` is written in C, and
519518
so I couldn't just monkey-patch out the static `date.today` method.
520519

@@ -556,14 +555,12 @@ is discussed in `this blog entry
556555
Mocking a Generator Method
557556
~~~~~~~~~~~~~~~~~~~~~~~~~~
558557

559-
A Python generator is a function or method that uses the `yield statement
560-
<https://docs.python.org/reference/simple_stmts.html#the-yield-statement>`_ to
561-
return a series of values when iterated over [#]_.
558+
A Python generator is a function or method that uses the :keyword:`yield` statement
559+
to return a series of values when iterated over [#]_.
562560

563561
A generator method / function is called to return the generator object. It is
564562
the generator object that is then iterated over. The protocol method for
565-
iteration is `__iter__
566-
<https://docs.python.org/library/stdtypes.html#container.__iter__>`_, so we can
563+
iteration is :meth:`~container.__iter__`, so we can
567564
mock this using a `MagicMock`.
568565

569566
Here's an example class with an "iter" method implemented as a generator:

0 commit comments

Comments
 (0)