From: Carlos Pita <[email-masked]>
Date: Mon, 2 Feb 2015 17:28:12 -0300

Here is a patch updated against current master.

I know you have closed this issue, but please reconsider it in the
light of my new proposal: it's very simple and PEP 8 friendly.

The implementation just set a :no-indent context after two or more
consecutive blank lines. That's it.

PEP 8 states: Separate top-level function and class definitions with
two blank lines.

This is not mandatory, of course, but it's often the real intention of
the coder and, in any case, it promotes honoring basic conventions.

Cheers
--
Carlos
diff --git a/.emacs.d/lisp/python.el b/.emacs.d/lisp/python.el
index bade9d9..788d09f 100644
--- a/.emacs.d/lisp/python.el
+++ b/.emacs.d/lisp/python.el
@@ -963,6 +963,15 @@ keyword
        ((let ((start (python-info-dedenter-statement-p)))
           (when start
             (cons :at-dedenter-block-start start))))
+       ;; After two or more blank lines.
+       ((save-excursion
+          (when (and (progn
+                       (forward-line -1)
+                       (python-info-current-line-empty-p))
+                     (progn
+                       (forward-line -1)
+                       (python-info-current-line-empty-p)))
+            (cons :no-indent 0))))
        ;; After normal line.
        ((let ((start (save-excursion
                        (back-to-indentation)