What is the proper way to comment functions in Python?

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

    While I agree that this should not be a comment, but a docstring as most (all?) answers suggest, I want to add numpydoc (a docstring style guide).

    If you do it like this, you can (1) automatically generate documentation and (2) people recognize this and have an easier time to read your code.

提交回复
热议问题