(original) (raw)
changeset: 88177:a9f73b44ea0e user: R David Murray rdmurray@bitdance.com date: Tue Dec 24 16:13:32 2013 -0500 files: Doc/library/abc.rst Doc/whatsnew/3.4.rst Lib/abc.py description: #16832: s/integer/object/ in docs/docstring, and add whatsnew entry. diff -r e847cb9055ab -r a9f73b44ea0e Doc/library/abc.rst --- a/Doc/library/abc.rst Tue Dec 24 15:59:57 2013 -0500 +++ b/Doc/library/abc.rst Tue Dec 24 16:13:32 2013 -0500 @@ -318,9 +318,9 @@ Returns the current abstract base class cache token. - The token is an opaque integer identifying the current version of the - abstract base class cache for virtual subclasses. This number changes - with every call to :meth:`ABCMeta.register` on any ABC. + The token is an opaque object (that supports equality testing) identifying + the current version of the abstract base class cache for virtual subclasses. + The token changes with every call to :meth:`ABCMeta.register` on any ABC. .. versionadded:: 3.4 diff -r e847cb9055ab -r a9f73b44ea0e Doc/whatsnew/3.4.rst --- a/Doc/whatsnew/3.4.rst Tue Dec 24 15:59:57 2013 -0500 +++ b/Doc/whatsnew/3.4.rst Tue Dec 24 16:13:32 2013 -0500 @@ -473,6 +473,12 @@ Improved Modules ================ +abc +--- + +New function :func:`abc.get_cache_token` can be used to know when to invalidate +caches that are affected by changes in the object graph. (Contributed +by Ćukasz Langa in :issue:`16832`.) aifc ---- diff -r e847cb9055ab -r a9f73b44ea0e Lib/abc.py --- a/Lib/abc.py Tue Dec 24 15:59:57 2013 -0500 +++ b/Lib/abc.py Tue Dec 24 16:13:32 2013 -0500 @@ -241,8 +241,8 @@ def get_cache_token(): """Returns the current ABC cache token. - The token is an opaque integer identifying the current version of - the ABC cache for virtual subclasses. This number changes with - every call to ``register()`` on any ABC. + The token is an opaque object (supporting equality testing) identifying the + current version of the ABC cache for virtual subclasses. The token changes + with every call to ``register()`` on any ABC. """ return ABCMeta._abc_invalidation_counter /rdmurray@bitdance.com