PE

PEP 8

Used in 642 python projects (avg ★45)

Python
Style Guide
Default
Used by 642 projects

Details

Language / Topic
pythonPython
Category
Style Guide

Rules

balanced
- Use snake_case for functions, variables, and module names.
- Use PascalCase for class names.
- Use UPPER_CASE for module-level constants.
- Indent with exactly 4 spaces per level; never use tabs.
- Limit lines to 79 characters.
- Group imports at the top: standard library first, then third-party, blank line, then local imports.
- Surround operators and colons with single spaces; add space after commas.
- Use two blank lines between top-level functions/classes; one blank line between class methods.
- Write complete sentences for module/class/function docstrings.
- Use descriptive names that are clear and unambiguous.