Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3edcc78

Browse files
committed
#16832: s/integer/object/ in docs/docstring, and add whatsnew entry.
1 parent 5ea9524 commit 3edcc78

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

Doc/library/abc.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

Doc/whatsnew/3.4.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,12 @@ trace memory blocks allocated by Python. It provides the following information:
473473
Improved 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

477483
aifc
478484
----

Lib/abc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ class ABC(metaclass=ABCMeta):
241241
def 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

0 commit comments

Comments
 (0)