Doxygen for Python:如何为嵌套函数生成文档 [英] Doxygen for Python: How to generate documentation for nested functions

查看:163
本文介绍了Doxygen for Python:如何为嵌套函数生成文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Doxygen记录我的Python代码.该代码利用了Python定义嵌套函数的功能.

I am documenting my Python code using Doxygen. The code makes use of Pythons capability of defining nested functions.

因此,我已将它们记录为仿佛它们是正常"功能,并设置了EXTRACT_ALL=YES.

So I have documented them as if they were "normal" functions and set EXTRACT_ALL=YES.

但是,嵌套函数仍然无法在任何地方找到.有什么方法可以使Doxygen做到这一点?

But still, the nested functions cannot be found anywhere. Is there a way to make Doxygen do that?

(Doxygen版本1.8.6)

(Doxygen version 1.8.6)

推荐答案

无法访问嵌套函数,因此请确保它没有文档化

there is no way to access nested functions so im sure it just doesnt document it

 def wrapper():
    def nested(a,b,c):
        return a+b+c
    return nested(1,2,3)

 #a user can call wrapper()
 print wrapper()
 #but there is no way to call nested
 print nested(7,7,7) #ERROR!!!

由于用户无法调用它,为什么要记录它?

since a user cannot call it why would you document it?

(真的,这只是一条评论,太长了,无法发布为评论)

(really this is just a comment that was too long to post as a comment)

这篇关于Doxygen for Python:如何为嵌套函数生成文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆