From 9fb7b7f0939c207355aec799cb67ebc8f2c80007 Mon Sep 17 00:00:00 2001 From: xqt Date: Thu, 12 Oct 2023 10:22:05 +0200 Subject: [PATCH] [doc] Update deprecations for tools module Change-Id: I0ae99e3a363ee40536efd84c951b3655b09b3614 --- pywikibot/tools/__init__.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py index 166161193c..0f07fc35c9 100644 --- a/pywikibot/tools/__init__.py +++ b/pywikibot/tools/__init__.py @@ -1,4 +1,20 @@ -"""Miscellaneous helper functions (not wiki-dependent).""" +"""Miscellaneous helper functions (not wiki-dependent). + +.. deprecated:: 7.6 + The *CombinedError*, *DequeGenerator*, *EmptyDefault*, *EMPTY_DEFAULT* + and *SizedKeyCollection* objects. Import them from + :mod:`tools.collections` instead. +.. deprecated:: 7.6 + The *itergroup* function. Use :func:`backports.batched` or + ``itertools.batched`` instead. +.. deprecated:: 7.6 + The *filter_unique*, *intersect_generators*, *islice_with_ellipsis* + and *roundrobin_generators* functions. Import them from + :mod:`tools.itertools` instead. +.. deprecated:: 7.7 + The *RLock*, *ThreadedGenerator* and *ThreadList* classes. + Import them from :mod:`tools.threading` instead. +""" # # (C) Pywikibot team, 2008-2023 # @@ -841,12 +857,14 @@ def wrapper(obj: object, *, force=False) -> Any: replacement_name='pywikibot.tools.collections.EMPTY_DEFAULT', since='7.6.0') -# Deprecate objects which has to be imported from tools.itertools instead +# Deprecate objects which has to be imported from backports instead wrapper.add_deprecated_attr( 'itergroup', # new replacement in 8.2 replacement_name='pywikibot.backports.batched', since='7.6.0') + +# Deprecate objects which has to be imported from tools.itertools instead wrapper.add_deprecated_attr( 'islice_with_ellipsis', replacement_name='pywikibot.tools.itertools.islice_with_ellipsis',