title: Python PEP 8: Blank lines at the beginning of a module
body: <p>There is a <a href="https://stackoverflow.com/questions/2953250/python-pep8-blank-lines-convention">question</a> who treat about this but not talk about all the points I interested.</p>
  
  <p>PEP 8 says about blank lines:</p>
  
  <pre><code>Separate top-level function and class definitions with two blank lines.
  </code></pre>
  
  <p>Then if you have:</p>
  
  <ol>
  <li><p>A module with only a class:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  
  class A(object):
      pass
  </code></pre>
  
  <p><strong>Do you separate the begin of the class and the encoding comment with two blank lines?</strong></p></li>
  <li><p>A module with import statement and classes:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  import module
  
  
  class B(object):
      pass
  
  
  class C(object):
      pass
  </code></pre>
  
  <p><strong>Do you separate the import statement and the encoding comment with one blank line?</strong></p>
  
  <p><strong>And the import statement and the begin of the class with two blank lines?</strong></p></li>
  <li><p>And a main module:</p>
  
  <pre><code>#!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  import module
  
  
  def main():
      a = module.A()
      return 0
  
  
  if __name__ == '__main__':
      status = main()
  </code></pre>
  
  <p><strong>Do you separate the import statement and the top-level function with two blank lines?</strong></p>
  
  <p><strong>And the end of the top-level function and the conditional statement with two blank lines?</strong></p></li>
  </ol>