What is the proper way to comment functions in Python?

前端 未结 10 1600
情书的邮戳
情书的邮戳 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:20

    Use a docstring, as others have already written.

    You can even go one step further and add a doctest to your docstring, making automated testing of your functions a snap.

提交回复
热议问题