我有一些在python中使用元类的代码.但是当sphinx autodoc运行时,它会给出错误:
WARNING: py:class reference target not found: type
错误发生在自动生成的.rst文件的行中:
.. automodule:: API.list.blockList
:members: # this is the line in error
:show-inheritance:
Run Code Online (Sandbox Code Playgroud)
并且blockList扩展了API.list.list,它已\__metaclass__设置为我的元类.
据我所知,sphinx并不认为内置类型类存在.我已经尝试导入内置类型,以使sphinx意识到它在那里,但这没有奏效.
如果我从API.list.list中删除元类赋值,并从代码中删除元类,那么sphinx工作正常.