@@ -1713,7 +1713,7 @@ first in the context of constructors.
17131713
17141714In 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
20002000former stores results at the instance level and the latter at the class
20012001level.
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
20042004any arguments. It does not create a reference to the instance. The
20052005cached 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
20092009instances accumulate, so too will the accumulated method results. They
20102010can 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 `
20132013arguments. It creates a reference to the instance unless special
20142014efforts 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
20452045The 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
20472047can't be made to work because it cannot detect changes to the
20482048attributes.
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,
20512051the class needs to define the :meth: `~object.__eq__ ` and :meth: `~object.__hash__ `
20522052methods so that the cache can detect relevant attribute updates::
20532053
@@ -2115,7 +2115,7 @@ the ``compile()`` function in that module interactively::
21152115
21162116This will write the ``.pyc `` to a ``__pycache__ `` subdirectory in the same
21172117location as ``foo.py `` (or you can override that with the optional parameter
2118- `` cfile `` ).
2118+ * cfile * ).
21192119
21202120You can also automatically compile all files in a directory or directories using
21212121the :mod: `compileall ` module. You can do it from the shell prompt by running
0 commit comments