PEP 8 – Style Guide for Python Code

GPTKB entity

Statements (33)
Predicate Object
gptkbp:instanceOf style
Python Enhancement Proposal
gptkbp:appliesTo gptkb:Python_programming_language
gptkbp:author gptkb:Guido_van_Rossum
gptkb:Barry_Warsaw
gptkb:Nick_Coghlan
gptkbp:category Programming style guides
Python software development
gptkbp:created 2001-07-05
https://www.w3.org/2000/01/rdf-schema#label PEP 8 – Style Guide for Python Code
gptkbp:influenced gptkb:Black_(Python_code_formatter)
gptkb:autopep8
gptkb:flake8
gptkb:pylint
gptkbp:JEP_number 8
gptkbp:language English
gptkbp:purpose Provide coding conventions for Python code
gptkbp:recommendation 4 spaces per indentation level
import standard libraries first, then third-party, then local imports
avoid extraneous whitespace
limit lines to 79 characters
use CapWords for class names
use UTF-8 encoding
use blank lines to separate functions and classes
use docstrings
use spaces around operators
use lowercase_with_underscores for function and variable names
gptkbp:status Active
gptkbp:title gptkb:PEP_8_–_Style_Guide_for_Python_Code
gptkbp:topic Python code style
gptkbp:url https://peps.python.org/pep-0008/
gptkbp:bfsParent gptkb:PEP_8
gptkbp:bfsLayer 6