美文网首页
Python 注释文档

Python 注释文档

作者: _沉默的疯子 | 来源:发表于2019-04-22 21:02 被阅读0次

    函数注释文档

    def test(name, age):
        """
        Rest风格 注释 
        :param name: 参数注释
        :param age: 参数注释
        :return: 返回注释
        """
        print("hello")
        return name
    
    def test1(name, age):
        """
        Google风格 This is groups style docs.
    
        Parameters:
            name - this is the name param
            age - this is a age param
    
        Returns:
            This is a description of what is returned
    
        Raises:
            KeyError - raises an exception
        """
        name = "andy"
        age = 10
        return "yoyo"
    
    help(test1)
    

    相关文章

      网友评论

          本文标题:Python 注释文档

          本文链接:https://www.haomeiwen.com/subject/qsaugqtx.html