What is the proper way to comment functions in Python?

前端 未结 10 1584
情书的邮戳
情书的邮戳 2021-01-30 01:58

Is there a generally accepted way to comment functions in Python? Is the following acceptable?

#########################################################
# Create         


        
10条回答
  •  醉话见心
    2021-01-30 02:26

    I would go for a documentation practice that integrates with a documentation tool such as Sphinx.

    The first step is to use a docstring:

    def add(self):
     """ Method which adds stuff
     """
    

提交回复
热议问题