Skip to content

Commit 8a8067e

Browse files
committed
Formatting
1 parent 46ea896 commit 8a8067e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Doc/faq/programming.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ first in the context of constructors.
17131713

17141714
In C++ you'd write:
17151715

1716-
.. code-block:: c
1716+
.. code-block:: c++
17171717

17181718
class C {
17191719
C() { cout << "No arguments\n"; }
@@ -2000,7 +2000,7 @@ The two principal tools for caching methods are
20002000
former stores results at the instance level and the latter at the class
20012001
level.
20022002

2003-
The *cached_property* approach only works with methods that do not take
2003+
The ``cached_property`` approach only works with methods that do not take
20042004
any arguments. It does not create a reference to the instance. The
20052005
cached method result will be kept only as long as the instance is alive.
20062006

@@ -2009,7 +2009,7 @@ method result will be released right away. The disadvantage is that if
20092009
instances accumulate, so too will the accumulated method results. They
20102010
can grow without bound.
20112011

2012-
The *lru_cache* approach works with methods that have :term:`hashable`
2012+
The ``lru_cache`` approach works with methods that have :term:`hashable`
20132013
arguments. It creates a reference to the instance unless special
20142014
efforts are made to pass in weak references.
20152015

@@ -2043,11 +2043,11 @@ This example shows the various techniques::
20432043
# Depends on the station_id, date, and units.
20442044

20452045
The above example assumes that the *station_id* never changes. If the
2046-
relevant instance attributes are mutable, the *cached_property* approach
2046+
relevant instance attributes are mutable, the ``cached_property`` approach
20472047
can't be made to work because it cannot detect changes to the
20482048
attributes.
20492049

2050-
To make the *lru_cache* approach work when the *station_id* is mutable,
2050+
To make the ``lru_cache`` approach work when the *station_id* is mutable,
20512051
the class needs to define the :meth:`~object.__eq__` and :meth:`~object.__hash__`
20522052
methods so that the cache can detect relevant attribute updates::
20532053

@@ -2115,7 +2115,7 @@ the ``compile()`` function in that module interactively::
21152115

21162116
This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same
21172117
location as ``foo.py`` (or you can override that with the optional parameter
2118-
``cfile``).
2118+
*cfile*).
21192119

21202120
You can also automatically compile all files in a directory or directories using
21212121
the :mod:`compileall` module. You can do it from the shell prompt by running

0 commit comments

Comments
 (0)