Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 1.09 KB

contribution.md

File metadata and controls

19 lines (15 loc) · 1.09 KB

Style Guide

PEP 8: Style Guide for Python Code

  • Use 4 spaces per indentation level.
  • Limit all lines to a maximum of 79 characters.
  • Separate top-level functions and class definitions with two blank lines.
  • Method definitions inside a class should be separated by one blank line.
  • Imports should be on separate lines and grouped in the following order: standard library, related third-party imports, and local application/library-specific imports.
  • Use spaces around operators and after commas, but not directly inside parentheses or brackets.
  • Avoid extraneous whitespace.
  • Follow the naming conventions: modules and packages should have short, lowercase names, classes should use CapWords, function and variable names should be lowercase with words separated by underscores.

PEP 257: Docstring Conventions

  • All modules, classes, and functions should have docstrings.
  • One-liners are for short, simple functions or methods.
  • Multi-line docstrings have a summary line, followed by a blank line and a more elaborate description.
  • Use triple double-quotes for docstrings, even for one-liners.