Skip to content

[pep8] Document empty blocks #671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pep-0008.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...block which is intentionally left 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: suppressed

looks like an unfinished thought.


Source File Encoding
--------------------

Expand Down Expand Up @@ -642,6 +654,7 @@ Other Recommendations

if foo == 'blah': one(); two(); three()


When to Use Trailing Commas
===========================

Expand Down