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

[pep8] Document empty blocks #671

wants to merge 1 commit into from

Conversation

ambv
Copy link
Contributor

@ambv ambv commented Jun 13, 2018

``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

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.

@gvanrossum
Copy link
Member

I still don't think this needs to make it into PEP 8 -- I don't think I've ever seen a debate about this or code doing it wrong until Łukasz brought it up on Twitter. We should exercise restraint when adding to PEP 8 -- it's already getting long, and there are more important things that it's not even mentioning.

@gvanrossum gvanrossum closed this Jun 13, 2018
@ambv ambv deleted the empty-blocks branch June 14, 2018 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants