From 7e648e87edefbe5f714263b4b80ed5cfa47419bc Mon Sep 17 00:00:00 2001 From: Daniel Greenfeld Date: Sat, 17 May 2014 16:36:42 -0700 Subject: [PATCH] Final Readme tweak of the day --- README.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 9280720..4bb0a56 100644 --- a/README.rst +++ b/README.rst @@ -27,8 +27,8 @@ Why? How to use it -------------- -Define a class with an expensive property. Every time you stay there the -price goes up by $50. I +Let's define a class with an expensive property. Every time you stay there the +price goes up by $50! .. code-block:: python @@ -48,10 +48,10 @@ Now run it: .. code-block:: python - >>> m = Monopoly() - >>> m.boardwalk + >>> monopoly = Monopoly() + >>> monopoly.boardwalk 550 - >>> m.boardwalk + >>> monopoly.boardwalk 600 Let's convert the boardwalk property into a `cached_property`. @@ -77,12 +77,12 @@ Now when we run it the price stays at $550. .. code-block:: python - >>> m = Monopoly() - >>> m.boardwalk + >>> monopoly = Monopoly() + >>> monopoly.boardwalk 550 - >>> m.boardwalk + >>> monopoly.boardwalk 550 - >>> m.boardwalk + >>> monopoly.boardwalk 550 Why doesn't the value of `m.boardwalk` change? Because it's a **cached property**! @@ -92,4 +92,4 @@ Credits * Django, Werkzueg, Bottle, and Zope for having their own implementations. This package uses the Django version. * Reinout Van Rees for pointing out the cached_property decorator to me. -* My awesome wife Audrey who created cookiecutter, which meant rolling this out took me just 15 minutes. \ No newline at end of file +* My awesome wife Audrey who created cookiecutter, which meant rolling this out took me just 15 minutes. -- 2.30.2