In python, what the underline parameter mean in function

前端 未结 3 1290
长发绾君心
长发绾君心 2020-12-30 05:12

For example, I read a code:

def parse_doc(self, _, doc):

What does the underline \"_\" mean?

3条回答
  •  半阙折子戏
    2020-12-30 05:41

    Like doc it's a variable name. Usually naming a variable _ indicates that it won't be used.

提交回复
热议问题