Instruction file imported from kevin-brown/open-ev-map (
.github/instructions/python-style-guide.instructions.md). Copyright stays with the author.
Follow the PEP 8 style guide for Python code. This means:
- Use 4 spaces per indentation level.
- Limit lines to 119 characters.
- Use blank lines to separate functions and classes.
- Use spaces around operators and after commas.
- Use single quotes for strings unless they contain single quotes.
- Use double quotes for strings that contain single quotes.
- Use descriptive variable and function names.
- Use
snake_casefor variable and function names. - Use
CamelCasefor class names. - Use
UPPERCASEfor constants. - Use
__init__for class constructors. - Use
importstatements at the top of the file. - Use
from module import functionfor specific imports. - Use
import modulefor module imports. - Use
tryandexceptfor error handling. - Use
withstatements for file handling. - Use
assertfor debugging. - Use
docstringsfor documenting functions and classes. - Use
type hintsfor function parameters and return types. - Use
f-stringsfor string formatting.