Skip to content

Commit

Permalink
Merge "[doc] Update deprecations for tools module"
Browse files Browse the repository at this point in the history
  • Loading branch information
xqt authored and Gerrit Code Review committed Oct 12, 2023
2 parents 55949dc + 9fb7b7f commit 1f9e2bb
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions pywikibot/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 1f9e2bb

Please sign in to comment.