hhatto/autopep8 — pull request #87 by chrismedrela (2013-09-27 11:28:08+00:00)
Title: Introduced --e701-exclude-classes and --e701-exclude-callables options.

I find it quite useful. For example, consider this code:

class CustomException(Exception): pass
class AnotherException(Exception): pass
class YetAnotherException(Exception): pass

This is absolutely fine. It's terse and more readable than this:

class CustomException(Exception):
pass

class AnotherException(Exception):
pass

class YetAnotherException(Exception):
pass

The same with functions/methods. Sometimes it's useful to define a helper function inside another function. It's preferred to avoid lambdas, so we type:

def foo(list):
def some_helper(x): return x.bar == 'bar'
def another_helper(x): return x.bar == 'another'
def yet_another_helper(x): return x.bar == 'yetanother'
(... do something ...)

It's better than:

def foo(list):
def some_helper(x):
return x % 2 == 0

def another_helper(x):
return x.bar == 'another'

def yet_another_helper(x):
return x.bar == 'yetanother'

(... do something ...)