Python Style Guide

--HIDE--

Introduction

Python Language Rules

Lint Imports Packages Exceptions Global Variables Nested/Local/Inner Classes and Functions List Comprehensions Default Iterators and Operators Generators Lambda Functions Conditional Expressions Default Argument Values Properties True/False Evaluations Deprecated Language Features Lexical Scoping Function and Method Decorators Threading Power Features

Python Style Rules

Semicolons Line Length Parentheses Indentation Blank Lines Whitespace Shebang Line Comments Classes Strings Files and Sockets TODO Comments Imports Formatting Statements Access Control Naming Main

Django Style Rules

Models Views Forms Urls

Python Style Guide

Python is the main scripting language. This style guide is a list of dos and don'ts for Python programs.

Contents

Python Language Rules

Lint, Imports, Packages, Exceptions, Global Variables, Nested/Local/Inner Classes and Functions, List Comprehensions, Default Iterators and Operators, Generators, Lambda Functions, Conditional Expressions, Default Argument Values, Properties, True/False Evaluations, Deprecated Language Features, Lexical Scoping, Function and Method Decorators, Threading, Power Features

Python Style Rules

Semicolons, Line Length, Parentheses, Indentation, Blank Lines, Whitespace, Shebang Line, Comments, Classes, Strings, Files and Sockets, TODO Comments, Imports Formatting, Statements, Access Control, Naming, Main

References

  1. Google Python Style Guide
  2. Type Hinting in PyCharm
  3. typing — Support for type hints
  4. PEP 484 -- Type Hints

results matching ""

    No results matching ""