Skip to content

Commit

Permalink
Fix #86 Implement dict's version (#95)
Browse files Browse the repository at this point in the history
* Add version to Cythonized code

* Implement version for pure python

* Add tests for getversion

* Add missing file

* Update doc and CHANGES

* Use global version counter

* Add more tests
  • Loading branch information
asvetlov committed Jun 10, 2017
1 parent 14dcf2e commit 29bdd12
Show file tree
Hide file tree
Showing 5 changed files with 393 additions and 154 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

* `.pop()` removes only first occurence, `.popone()` added #92

* Implement dict's version #86

2.1.7 (2017-05-29)
------------------

Expand Down
20 changes: 20 additions & 0 deletions docs/multidict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,26 @@ CIMultiDictProxy
The class is inherited from :class:`MultiDict`.


Version
=======

All multidicts have an internal version flag. It's changed on every
dict update, thus the flag could be used for checks like cache
expiring etc.

.. function:: getversion(mdict)

Return a version of given *mdict* object (works for proxies also).

The type of returned value is opaque and should be used for
equality tests only (``==`` and ``!=``), ordering is not allowed
while not prohibited explicitly.

.. versionadded:: 3.0

.. seealso:: :pep:`509`


istr
====

Expand Down

0 comments on commit 29bdd12

Please sign in to comment.