Two empty lines before function definitions is part of the PEP8 style standard, which is widely used in the Python community. Most Python autoformatters and linters default to PEP8.
As for empty lines within code, I personally find it helpful to visually separate logical segments.
> As for empty lines within code, I personally find it helpful to visually separate logical segments.
I see it as, if a function is like a paragraph, then the whitespace between lines deliminates sentences. I very much dislike run on sentences that are attempting to explain complex rules/topics in english and in code. Spatial grouping is very natural for the eyes and mind.
As for empty lines within code, I personally find it helpful to visually separate logical segments.