Skip to content

Instantly share code, notes, and snippets.

@kawa-kokosowa
Last active December 20, 2017 23:58
Show Gist options
  • Save kawa-kokosowa/63f5f1a29997dcfae7bf6becc1a6bd35 to your computer and use it in GitHub Desktop.
Save kawa-kokosowa/63f5f1a29997dcfae7bf6becc1a6bd35 to your computer and use it in GitHub Desktop.
Lily's Python Style: The particularities I've learned over the years

Lily's Nuanced Python Style

This style guide elaborates on pycode-style.

Syntax

When to use quotes...

  • ''' is for string values.
  • """ is for docstrings.
  • ' is the default for strings.
  • " when the string contains an apostrophe '.

Whitespace

Long sequences

How import statements are grouped

Constants

Constants should come right after imports, with one line of blank space between like so:

import os
import sys

A_NICE_CONSTANT = 'Wow this is a nice constant'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment