Bug report
When collections.deque is subclassed and the resulting class is documented with Sphinx using the option :inherited-members:, the following error appears:
WARNING: py:class reference target not found: integer -- return number of occurrences of value
I assume this is because the PyDoc_STRVAR docstring of the C-implementation is not compliant to PEP-7 as required in PyDoc_STRVAR:
|
PyDoc_STRVAR(count_doc, |
|
"D.count(value) -> integer -- return number of occurrences of value"); |
And everything after -> is interpreted as type hint.
This can be reproduced with e.g. a python module sub_deque.py:
class SubDeque(deque):
pass
and a documenation file docs/src/sub_deque.rst:
.. automodule:: sub_deque
:inherited-members:
which is then built with Sphinx: sphinx-build -W docs/src docs/dist.
I'd be happy to provide a patch for this myself if you feel this issue should be fixed.
Your environment
- CPython versions tested on: 3.7 - 3.11
- Operating system and architecture: Arch Linux & Ubuntu
Linked PRs
Reactions are currently unavailable
Bug report
When collections.deque is subclassed and the resulting class is documented with Sphinx using the option :inherited-members:, the following error appears:
I assume this is because the PyDoc_STRVAR docstring of the C-implementation is not compliant to PEP-7 as required in PyDoc_STRVAR:
cpython/Modules/_collectionsmodule.c
Lines 992 to 993 in d9dff4c
And everything after -> is interpreted as type hint.
This can be reproduced with e.g. a python module sub_deque.py:
class SubDeque(deque): passand a documenation file docs/src/sub_deque.rst:
which is then built with Sphinx: sphinx-build -W docs/src docs/dist.
I'd be happy to provide a patch for this myself if you feel this issue should be fixed.
Your environment
Linked PRs