I am running into an error/warning when inheriting from collections.deque
. Sphinx complains:
utils.py:docstring of utils.Test.count:1: WARNING: py:class reference target not found: integer -- return number of occurrences of value
For this example, utils.py
only contains
from collections import deque
class Test(deque):
pass
My best guess is that this might be caused by deque
being implemented in C, since integer
is not a valid Python type. Looking around a bit, I found this line in the CPython source of collections
, which could be exactly that part, should my hypothesis be correct. But I have no clue about CPython, the inner workings of Sphinx autodoc and the boundary between those worlds.
Is there a good solution to correcting this, whether in the annotation of CPython or the autodoc plugin?