Fragments

July 12, 2010 at 12:35pm
Home

How I organize Python code

I live and die by PEP-8.

[imports]
    (import, then from ... import ...)
        standard library
        third-party libraries
        application

[static globals]
    LOG (logging)
    Constants

[exceptions]
    class XException(Exception):
        """Documentation..."""

[functions with no shared state]
[classes (used to encapsulate shared state)]
[initializers]

pep8 is my lint.