I will try to answer your question by sticking to your Python example, quoting their style guide.
From PEP-8 :
Method definitions within a class are separated by a single blank line.
From Wikipedia (blank line) :
An empty line usually refers to a line containing null characters (not counting the characters at the end of the line); although it can also refer to any line that does not contain visible characters (consisting only of spaces).
If you consider the definition of Wikipedia, you may ask why null characters are preferable.
For one, itβs easier, even if autoindent is enabled in your editor, you just fill your file with extra bytes for no good reason.
Secondly, the regex for an empty null character string is also simpler, '^ $' usually has something like '^ \ s * $'.
As the other answers pointed out, it makes no sense to perform wise to put spaces. Without good reason for this, I would say that it is best to abandon this and keep it simple. Can you imagine a situation where a line of a null character will be processed differently than a line with some spaces? I would not like to program in this language. Putting in spaces seems baroque to me.
source share