What's the advantage of a trailing underscore in Python naming?

后端 未结 3 1246
渐次进展
渐次进展 2021-01-17 21:06

I am used to naming Python arguments in this way:

my_argument=\'foo\'

what\'s the advantage if I do this instead:

my_argum         


        
3条回答
  •  野的像风
    2021-01-17 21:19

    PEP8 does not recommend this naming convention, except for names that would otherwise conflict with keywords. my_argument obviously does not conflict, so there is no reason to use an underscore and PEP8 does not recommend that you do.

提交回复
热议问题