summaryrefslogtreecommitdiff
path: root/Doc/library/abc.rst
diff options
context:
space:
mode:
authorŁukasz Langa <lukasz@langa.pl>2013-05-25 18:41:50 +0200
committerŁukasz Langa <lukasz@langa.pl>2013-05-25 18:41:50 +0200
commiteadd8cf507e876a6ea4c338a0004954d2d732ac0 (patch)
tree5231b12d19eacda81a3eb49f85265fd099619276 /Doc/library/abc.rst
parentb961955e95107e7667944e91bea50bfb760285b7 (diff)
downloadcpython-git-eadd8cf507e876a6ea4c338a0004954d2d732ac0.tar.gz
Fix #16832 - expose cache validity checking support in ABCMeta
Diffstat (limited to 'Doc/library/abc.rst')
-rw-r--r--Doc/library/abc.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst
index 27abb605fd..1f21b5750d 100644
--- a/Doc/library/abc.rst
+++ b/Doc/library/abc.rst
@@ -58,6 +58,10 @@ This module provides the following classes:
.. versionchanged:: 3.3
Returns the registered subclass, to allow usage as a class decorator.
+ .. versionchanged:: 3.4
+ To detect calls to :meth:`register`, you can use the
+ :func:`get_cache_token` function.
+
You can also override this method in an abstract base class:
.. method:: __subclasshook__(subclass)
@@ -308,6 +312,19 @@ The :mod:`abc` module also provides the following decorators:
:func:`abstractmethod`, making this decorator redundant.
+The :mod:`abc` module also provides the following functions:
+
+.. function:: get_cache_token()
+
+ 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.
+
+ .. versionadded:: 3.4
+
+
.. rubric:: Footnotes
.. [#] C++ programmers should note that Python's virtual base class