What is the naming convention in Python for variable and function names?

后端 未结 13 2292
生来不讨喜
生来不讨喜 2020-11-22 08:50

Coming from a C# background the naming convention for variables and method names are usually either camelCase or PascalCase:



        
13条回答
  •  长情又很酷
    2020-11-22 09:33

    There is a paper about this: http://www.cs.kent.edu/~jmaletic/papers/ICPC2010-CamelCaseUnderScoreClouds.pdf

    TL;DR It says that snake_case is more readable than camelCase. That's why modern languages use (or should use) snake wherever they can.

提交回复
热议问题