Hướng dẫn python pep8 cheat sheet
Never use l, O, or I single letter names as these can be mistaken for 1 and 0, depending on typeface O = 2 # This may look like you're trying to reassign 2 to zero Function function, my_function Variable x, var, my_variable Class Model, MyClass Method class_method, method Constant CONSTANT, MY_CONSTANT, MY_LONG_CONSTANT Module module.py, my_module.py Package package, mypackage Maximum Line Length and Line Breaking
Identation
Comments
Block Comments
Inline Comments
When to Avoid Adding Whitespace
Programming Recommendations
Code Layout
Indentation Following Line Breaks
Indentation Following Line Breaks 2
Where to Put the Closing Brace
Documentation Strings
Whitespace Around Binary Operators
When to Ignore PEP 8
|