Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.5 KB

CODE-STYLE.md

File metadata and controls

43 lines (28 loc) · 1.5 KB

STEM-Ecosystem Code Style

This document is rather short because all Python projects should follow the PEP 8 style guide available on Python's website.

There's a lot in that document, but we'll look at the most important parts.

Tabs or Spaces?

It's no surprise that indentation is incredibly important in Python. PEP 8 specifies:

Spaces are the preferred indentation method. Tabs should be used solely to remain consistent with code that is already indented with tabs.

In the PEP 8 Code Lay-out section, it says:

Use 4 spaces per indentation level.

So we'll be using 4 spaces in our project! I recommend setting up your code editor for that specification so you don't have to think about it!

Maximum Line Length

PEP 8 specifies the maximum line length we should be using. Thankfully, it's pretty standard so it'll be simple to use!

Limit all lines to a maximum of 79 characters.

For flowing long blocks of text with fewer structural restrictions (docstrings or comments), the line length should be limited to 72 characters.

Other Useful Sections

For all other questions, feel free to check out the main PEP 8 document)! There's a lot of good stuff in there!