Manual:Coding conventions/Python

This page describes the coding conventions for Python projects that are a part of the MediaWiki project or supporting projects.

General Structure
For anything not covered in this document, please refer to Python Enhancement Proposal 0008 for the general practice. The following sections are for the most part a summary of the most commonly referred to parts of PEP8.

Whitespace

 * Lines should be indented with 4 spaces.
 * Lines at the end of files should end with a newline, just like every other line in the file.