How to document python function parameter types?

前端 未结 6 1340
名媛妹妹
名媛妹妹 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:14

    You need to add an exclamation mark at the start of the Python docstring for Doxygen to parse it correctly.

    def myMethod(self, name, image):
        """!
        Does something ...
    
        @param name String: name of the image
        @param image Image: instance of Image Class or a string indicating the filename.
    
        @return Return True if operation succeeded or False.
        """
        return True
    

提交回复
热议问题