Skip to content

编码规范

StarWorld edited this page Apr 4, 2024 · 3 revisions

1. 命名

类命名:UpperCamel

class MyClass:
    pass

函数、参数命名:lower_underscore

def my_function(my_parameter: Type):
    pass

变量命名:lower_underscore

my_variable = None

常量命名:UPPER_UNDERSCORE

MY_CONSTANT = None

2.缩进

空格:使用四空格 (\u0020)

Clone this wiki locally