[Python-checkins] cpython (3.4): Fix external links to docs.python.org to use internal links instead.
georg.brandl
python-checkins at python.org
Wed Oct 29 09:00:46 CET 2014
https://hg.python.org/cpython/rev/2c193a27e69c
changeset: 93236:2c193a27e69c
branch: 3.4
parent: 93234:4fb4c192736b
user: Georg Brandl <georg at python.org>
date: Wed Oct 29 09:00:30 2014 +0100
summary:
Fix external links to docs.python.org to use internal links instead.
files:
Doc/howto/pyporting.rst | 6 +++---
Doc/library/unittest.mock-examples.rst | 13 +++++--------
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/Doc/howto/pyporting.rst b/Doc/howto/pyporting.rst
--- a/Doc/howto/pyporting.rst
+++ b/Doc/howto/pyporting.rst
@@ -39,7 +39,9 @@
With that done, your options are:
-* If you are dropping Python 2 support, use 2to3_ to port to Python 3
+* If you are dropping Python 2 support, use :ref:`2to3 <2to3-reference>` to port
+ to Python 3
+
* If you are keeping Python 2 support, then start writing Python 2/3-compatible
code starting **TODAY**
@@ -601,8 +603,6 @@
please email the python-porting_ mailing list.
-
-.. _2to3: https://docs.python.org/2/library/2to3.html
.. _3to2: https://pypi.python.org/pypi/3to2
.. _Cheeseshop: PyPI_
.. _coverage: https://pypi.python.org/pypi/coverage
diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst
--- a/Doc/library/unittest.mock-examples.rst
+++ b/Doc/library/unittest.mock-examples.rst
@@ -512,9 +512,8 @@
Partial mocking
~~~~~~~~~~~~~~~
-In some tests I wanted to mock out a call to `datetime.date.today()
-<https://docs.python.org/library/datetime.html#datetime.date.today>`_ to return
-a known date, but I didn't want to prevent the code under test from
+In some tests I wanted to mock out a call to :func:`datetime.date.today`
+to return a known date, but I didn't want to prevent the code under test from
creating new date objects. Unfortunately `datetime.date` is written in C, and
so I couldn't just monkey-patch out the static `date.today` method.
@@ -556,14 +555,12 @@
Mocking a Generator Method
~~~~~~~~~~~~~~~~~~~~~~~~~~
-A Python generator is a function or method that uses the `yield statement
-<https://docs.python.org/reference/simple_stmts.html#the-yield-statement>`_ to
-return a series of values when iterated over [#]_.
+A Python generator is a function or method that uses the :keyword:`yield` statement
+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
-iteration is `__iter__
-<https://docs.python.org/library/stdtypes.html#container.__iter__>`_, so we can
+iteration is :meth:`~container.__iter__`, so we can
mock this using a `MagicMock`.
Here's an example class with an "iter" method implemented as a generator:
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list