From 70700e8a0c1fc9f1f8cefc608f24b20d6a742d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Langa?= Date: Wed, 13 Jun 2018 15:23:23 -0700 Subject: [PATCH] [pep8] Document empty blocks Original discussion: https://twitter.com/llanga/status/1006974601723723776 --- pep-0008.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pep-0008.txt b/pep-0008.txt index 9b7fa0688bb..0ee014d1bb2 100644 --- a/pep-0008.txt +++ b/pep-0008.txt @@ -310,6 +310,18 @@ Note, some editors and web-based code viewers may not recognize control-L as a form feed and will show another glyph in its place. +Empty blocks +------------ + +Use ``pass`` to denote a block is intentionally empty. In empty +class or function bodies, prefer a meaningful docstring instead of +``pass``. + +Do not use ``...`` or ``None`` for this purpose. The former suggests +"details supressed" instead of "there is nothing there". The latter +looks like an unfinished thought. + + Source File Encoding -------------------- @@ -642,6 +654,7 @@ Other Recommendations if foo == 'blah': one(); two(); three() + When to Use Trailing Commas ===========================