
PEP 8 — Python style guide:
4 spaces for indentation (not tabs)
Max line length: 79 characters
Two blank lines between top-level functions/classes
One blank line between methods
Spaces around operators: x = 1 not x=1
Naming conventions:
snake_case for variables and functions
PascalCase for classes
UPPER_CASE for constants
_private for internal use
Pythonic patterns:
# Bad
if len(my_list) > 0:
# Good
if my_list:
# Bad
if x == True:
# Good
if x:
# Bad
result = []
for x in range(10):
result.append(x**2)
# Good
result = [x**2 for x in range(10)]Tools: black (auto-formatter), flake8 (linter), isort (import sorter). Run them before every commit.
Reference:
TaskLoco™ — The Sticky Note GOAT