从C#背景来看,变量和方法的命名约定通常是camelCase或PascalCase。
在Python中,我见过上述的写法,但我也见过使用snake_case的写法。
有没有更好、更明确的Python编码风格?
// C# example
string thisIsMyVariable = "a"
public void ThisIsMyMethod()
在Python中,我见过上述的写法,但我也见过使用snake_case的写法。
# python example
this_is_my_variable = 'a'
def this_is_my_function():
有没有更好、更明确的Python编码风格?
library_function(my_arg)
)。 - Lan