Why do Python function docs include the comma after the bracket for optional args?

后端 未结 5 1598
灰色年华
灰色年华 2020-12-03 04:08

The format of the function signatures in the Python docs is a bit confusing. What is the significance in putting the comma after the open bracket, rather than before? What

5条回答
  •  北海茫月
    2020-12-03 04:57

    The open bracket indicates an optional argument. If the comma were outside the bracket, you would have to type it even if you didn't want to use the pos argument (for example).

提交回复
热议问题