Docstring for variable

前端 未结 9 1925
予麋鹿
予麋鹿 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:04

    To add to to ford's answer about Epydoc, note that PyCharm will also use a string literal as the documentation for a variable in a class:

    class Fields_Obj:
        DefaultValue=None
        """Get/set the default value of the data field"""
    

提交回复
热议问题