小编Dou*_*der的帖子

Sphinx autodoc给出警告:找不到py:class引用目标:键入警告

我有一些在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工作正常.

python metaclass python-sphinx autodoc

14
推荐指数
1
解决办法
2214
查看次数

标签 统计

autodoc ×1

metaclass ×1

python ×1

python-sphinx ×1