From 822fe9e593778777c290313e65e8a5501e90e835 Mon Sep 17 00:00:00 2001 From: Tiago Boldt Sousa Date: Thu, 22 May 2025 11:01:27 +0100 Subject: [PATCH] Clarify how a blank line between imports looks like --- peps/pep-0008.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/peps/pep-0008.rst b/peps/pep-0008.rst index d14c9e97b12..f9768a6d1ba 100644 --- a/peps/pep-0008.rst +++ b/peps/pep-0008.rst @@ -382,7 +382,17 @@ Imports 2. Related third party imports. 3. Local application/library specific imports. - You should put a blank line between each group of imports. + You should put a blank line between each group of imports: + + .. code-block:: + :class: good + + import os + import sys + + import mypkg.sibling + from mypkg import sibling + from mypkg.sibling import example - Absolute imports are recommended, as they are usually more readable and tend to be better behaved (or at least give better error