How to document python function parameter types?

前端 未结 6 1350
名媛妹妹
名媛妹妹 2020-12-15 05:40

I know that the parameters can be any object but for the documentation it is quite important to specify what you would expect.

First is how to specify a parameter ty

6条回答
  •  余生分开走
    2020-12-15 06:25

    Yup, @docu is right - this is the (IMHO best) way to combine both documentation schemes more or less seamlessly. If, on the other hand, you also want to do something like putting text on the doxygen-generated index page, you would add

    ##
    # @mainpage (Sub)Heading for the doxygen-generated index page
    # Text that goes right onto the doxygen-generated index page
    

    somewhere at the beginning of your Python code.

    In other words, where doxygen does not expect Python comments, use ## to alert it that there are tags for it. Where it expects Python comments (e.g. at the beginning of functions or classes), use """!.

提交回复
热议问题