File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -318,9 +318,9 @@ The :mod:`abc` module also provides the following functions:
318318
319319 Returns the current abstract base class cache token.
320320
321- The token is an opaque integer identifying the current version of the
322- abstract base class cache for virtual subclasses. This number changes
323- with every call to :meth: `ABCMeta.register ` on any ABC.
321+ The token is an opaque object (that supports equality testing) identifying
322+ the current version of the abstract base class cache for virtual subclasses.
323+ The token changes with every call to :meth: `ABCMeta.register ` on any ABC.
324324
325325 .. versionadded :: 3.4
326326
Original file line number Diff line number Diff line change @@ -473,6 +473,12 @@ trace memory blocks allocated by Python. It provides the following information:
473473Improved Modules
474474================
475475
476+ abc
477+ ---
478+
479+ New function :func: `abc.get_cache_token ` can be used to know when to invalidate
480+ caches that are affected by changes in the object graph. (Contributed
481+ by Łukasz Langa in :issue: `16832 `.)
476482
477483aifc
478484----
Original file line number Diff line number Diff line change @@ -241,8 +241,8 @@ class ABC(metaclass=ABCMeta):
241241def get_cache_token ():
242242 """Returns the current ABC cache token.
243243
244- The token is an opaque integer identifying the current version of
245- the ABC cache for virtual subclasses. This number changes with
246- every call to ``register()`` on any ABC.
244+ The token is an opaque object (supporting equality testing) identifying the
245+ current version of the ABC cache for virtual subclasses. The token changes
246+ with every call to ``register()`` on any ABC.
247247 """
248248 return ABCMeta ._abc_invalidation_counter
You can’t perform that action at this time.
0 commit comments