Docstring for variable

前端 未结 9 1928
予麋鹿
予麋鹿 2021-01-31 13:35

Is it posible to use docstring for plain variable? For example I have module called t

def f():
    \"\"\"f\"\"\"

l = lambda x: x
\"\"\"l\"\"\"
         


        
9条回答
  •  暖寄归人
    2021-01-31 14:15

    Some python documentation scripts have notation that can be use in the module/classes docstring to document a var.

    E.g. for spinx, you can use :var and :ivar. See this document (about half-way down).

提交回复
热议问题