Commits

Mike Bayer committed 640608b

- changelog
- clean up docs

Comments (0)

Files changed (2)

docs/build/changelog.rst

 
     .. change::
         :tags: feature
+        :tickets: 55
+
+      Added a ``get()`` method to complement the ``set()``, ``invalidate()``
+      and ``refresh()`` methods established on functions decorated by
+      :meth:`.CacheRegion.cache_on_arguments` and
+      :meth:`.CacheRegion.cache_multi_on_arguments`.  Pullreq courtesy
+      Eric Hanchrow.
+
+    .. change::
+        :tags: feature
         :pullreq: 11
 
       Added a new variant on :class:`.MemoryBackend`, :class:`.MemoryPickleBackend`.

dogpile/cache/region.py

         .. versionadded:: 0.5.0 Added ``refresh()`` method to decorated
            function.
 
-        Lastly, a ``get()`` attribute returns either the value cached
-        for the given key, or else the token ``NO_VALUE``.  So for the example above,
+        Lastly, the ``get()`` method returns either the value cached
+        for the given key, or the token ``NO_VALUE`` if no such key
+        exists::
 
-            generate_something.get(5, 6)
-
-        would return ``newvalue``, whereas
-
-            generate_something(99, 100)
-
-        would return ``NO_VALUE``.
+            value = generate_something.get(5, 6)
 
         .. versionadded:: 0.5.3 Added ``get()`` method to decorated
-        function.
+           function.
 
         The default key generation will use the name
         of the function, the module name for the function,
             generate_something.set({"k1": "value1",
                                     "k2": "value2", "k3": "value3"})
 
-        an ``invalidate()`` method, which has the effect of deleting
+        ...an ``invalidate()`` method, which has the effect of deleting
         the given sequence of keys using the same mechanism as that of
         :meth:`.CacheRegion.delete_multi`::
 
             generate_something.invalidate("k1", "k2", "k3")
 
-        and finally a ``refresh()`` method, which will call the creation
+        ...a ``refresh()`` method, which will call the creation
         function, cache the new values, and return them::
 
             values = generate_something.refresh("k1", "k2", "k3")
 
+        ...and a ``get()`` method, which will return values
+        based on the given arguments::
+
+            values = generate_something.get("k1", "k2", "k3")
+
+        .. versionadded:: 0.5.3 Added ``get()`` method to decorated
+           function.
+
         Parameters passed to :meth:`.CacheRegion.cache_multi_on_arguments`
         have the same meaning as those passed to
         :meth:`.CacheRegion.cache_on_arguments`.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.