最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Sphinx viewcode does not work for inherited members - Stack Overflow

programmeradmin4浏览0评论

Trying to document the inherited members (mixins) of my Python class with Sphinx.

I've got the following in conf.py:

extensions = ["sphinx.ext.viewcode", "sphinx.ext.autodoc"]

and the following in index.rst:

.. autoclass:: My_Module.My_Class
    :show-inheritance: True
    :inherited-members: True
    :private-members:

The functions directly defined in my class have the [source] link available.

Those inherited functions do not have the [source] link available.

If I create an automodule of the inherited class within index.rst, the [source] link does show up, but I don't want 2 copies of the inherited functions.

After a few hours of searching, I figured I'd ask you folks. I'm stumped.

Can you help me figure out how to get the source links to the inherited functions?

发布评论

评论列表(0)

  1. 暂无评论