About Four Spaces
Four Spaces is an independent English-language publication about Python style and good coding practice: what PEP 8 and related guides actually say, how linters and formatters apply them, and how to write code that the next person can read. It is written for students, self-taught developers and working programmers who want the reasons behind the rules.
What we publish
- PEP 8, section by section: the style guide as a whole, layout and line length, whitespace and blank lines, naming, imports and the programming recommendations.
- Docstrings, comments and types: PEP 257, useful comments and type hints from PEP 484 onwards.
- Linters and formatters: pycodestyle and its error codes, flake8, pylint, black, ruff and pre-commit hooks, described from their official documentation without recommending one product over another.
- Readable code in practice: readability beyond the rules, code review, bringing an old codebase in line, and practical notes on developers' working lives.
The style checker
The checker on the home page is a small JavaScript program written for this site. It reimplements a documented subset of the checks of pycodestyle, the reference PEP 8 checker maintained by the Python Code Quality Authority (PyCQA), and reports the same codes. It runs entirely in your browser: the code you paste or open is never sent to a server. It does not replace pycodestyle, flake8 or ruff, and the home page lists what it does and does not check.
How articles are researched
- Primary sources first. The text of the PEPs on peps.python.org, the official Python documentation and the documentation of each tool. Every article ends with its sources.
- Tested examples. Code examples are run with Python 3.13 before publication, and tool output shown in articles was produced by the tool versions named in the sources.
- Dated facts. Tools change quickly; we say which version a statement refers to, and every article carries a publication date, with an "Updated" date when it changes.
- No invented details. No fictional authors, no made-up praise from users, no numbers pulled from thin air. Each guide goes out under the Four Spaces name alone.
Independence
Four Spaces sells nothing, has no affiliate links, accepts no sponsored content and is not connected to the Python Software Foundation, the PyCQA or any of the projects and companies whose tools it describes. Publisher details are on the legal notice page.
About this domain
The domain pep8online.com previously hosted "PEP8 online", a free web tool, created by an independent developer and first archived in 2012, that checked pasted or uploaded Python code against PEP 8 using the pep8 module (the checker that was renamed pycodestyle in 2016), with an option to share results by link. Archived copies show the tool online until at least September 2022; later captures of the domain show parking pages. Four Spaces is a new, separate publication: it has no connection with the former tool or its author, and it has not reused any of the former site's text, code, logo or design. Because other websites still link to this domain, the old checker's addresses now lead to the new checker on the home page.
Contact and corrections
Spotted a PEP 8 rule we misread, or a tool option that has changed since we wrote about it? The contact page explains how to tell us.