>>> monopoly.boardwalk
600
-Let's convert the boardwalk property into a `cached_property`.
+Let's convert the boardwalk property into a ``cached_property``.
.. code-block:: python
>>> monopoly.boardwalk
550
-Why doesn't the value of `monopoly.boardwalk` change? Because it's a **cached property**!
+Why doesn't the value of ``monopoly.boardwalk`` change? Because it's a **cached property**!
Invalidating the Cache
----------------------
>>> monopoly.boardwalk
550
>>> # invalidate the cache
- >>> del monopoly.boardwalk
+ >>> del monopoly['boardwalk']
>>> # request the boardwalk property again
>>> monopoly.boardwalk
600
Working with Threads
---------------------
-What if a whole bunch of people want to stay at Boardwalk all at once? This means using threads, which unfortunately causes problems with the standard `cached_property`. In this case, switch to using the `threaded_cached_property`:
+What if a whole bunch of people want to stay at Boardwalk all at once? This means using threads, which
+unfortunately causes problems with the standard ``cached_property``. In this case, switch to using the
+``threaded_cached_property``:
.. code-block:: python
* Pip, Django, Werkzueg, Bottle, Pyramid, and Zope for having their own implementations. This package uses an implementation that matches the Bottle version.
* Reinout Van Rees for pointing out the `cached_property` decorator to me.
* My awesome wife `@audreyr`_ who created `cookiecutter`_, which meant rolling this out took me just 15 minutes.
+* @tinche for pointing out the threading issue and providing a solution.
+* @bcho for providing the time-to-expire feature
.. _`@audreyr`: https://github.com/audreyr
.. _`cookiecutter`: https://github.com/audreyr/cookiecutter