I have a simple question. Imagine I have a Python file like this:
#!/usr/bin/env python3
"""Module docstring."""
import os
print(os.name)
How many blank lines should be between the module docstring and the first import?
PEP 8 doesn't seem to mention anything on this. I think the answer is either one or two blank lines.
Is there a particular reason to go with one or two lines of whitespace? Is there an accepted best practice here?
My Thoughts
Per PEP 8's Module Level Dunder Names section, it seems the spacing is one line. Perhaps this is the way to go.
It should be one blank line before the first import and one blank line between other groups of imports. If the code after the last import is a function, put two blank lines; otherwise one blank line.