Deprecate unused and untested sphinx.util functions

sphinx.util.attrdict: Last use removed in
b09e628b0f.

sphinx.util.PeekableIterator: Last use removed in
85b8a451a6.
This commit is contained in:
Jon Dufresne 2018-12-09 14:45:33 -08:00
parent b13a6ff3e6
commit 3a96ce6591
3 changed files with 19 additions and 0 deletions

View File

@ -50,9 +50,11 @@ Deprecated
* ``sphinx.ext.doctest.doctest_encode()``
* ``sphinx.io.SphinxRSTFileInput``
* ``sphinx.testing.util.remove_unicode_literal()``
* ``sphinx.util.attrdict``
* ``sphinx.util.force_decode()``
* ``sphinx.util.get_matching_docs()`` is deprecated
* ``sphinx.util.osutil.walk()``
* ``sphinx.util.PeekableIterator``
* ``sphinx.util.pycompat.u``
* ``sphinx.writers.latex.LaTeXTranslator.babel_defmacro()``
* ``sphinx.writers.latex.TextTranslator._make_visit_admonition()``

View File

@ -162,6 +162,11 @@ The following is a list of deprecated interfaces.
- 4.0
- N/A
* - ``sphinx.util.attrdict``
- 2.0
- 4.0
- N/A
* - ``sphinx.util.force_decode()``
- 2.0
- 4.0
@ -182,6 +187,11 @@ The following is a list of deprecated interfaces.
- 4.0
- N/A
* - ``sphinx.util.PeekableIterator``
- 2.0
- 4.0
- N/A
* - ``sphinx.application.Sphinx._setting_up_extension``
- 2.0
- 3.0

View File

@ -499,6 +499,11 @@ def force_decode(string, encoding):
class attrdict(dict):
def __init__(self, *args, **kwargs):
super(attrdict, self).__init__(*args, **kwargs)
warnings.warn('The attrdict class is deprecated.',
RemovedInSphinx40Warning, stacklevel=2)
def __getattr__(self, key):
# type: (unicode) -> unicode
return self[key]
@ -573,6 +578,8 @@ class PeekableIterator:
# type: (Iterable) -> None
self.remaining = deque() # type: deque
self._iterator = iter(iterable)
warnings.warn('PeekableIterator is deprecated.',
RemovedInSphinx40Warning, stacklevel=2)
def __iter__(self):
# type: () -> PeekableIterator