Skip to content
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

A blank line right after the function definition must be removed #2887

Closed
AIGeneratedUsername opened this issue Feb 20, 2022 · 1 comment
Closed
Labels
F: empty lines Wasting vertical space efficiently. R: duplicate This issue or pull request already exists T: style What do we want Blackened code to look like?

Comments

@AIGeneratedUsername
Copy link

AIGeneratedUsername commented Feb 20, 2022

Describe the style change

I think this is obvious enough that a blank line right after the function definition is against PEP-8 and against how people write functions, so better just see the examples below.

Examples in the current Black style

def func():

    return "Hello"

Desired style

def func():
    return "Hello"

Additional context

This is the only reason to use blank lines inside functions:

Use blank lines in functions, sparingly, to indicate logical sections.

But the blank line must not be right after the function definition.

Versions

black-22.1.0
Python 3.10

@AIGeneratedUsername AIGeneratedUsername added the T: style What do we want Blackened code to look like? label Feb 20, 2022
@AIGeneratedUsername AIGeneratedUsername changed the title fix: blank line right after the function definition must be removed Blank line right after the function definition must be removed Feb 20, 2022
@AIGeneratedUsername AIGeneratedUsername changed the title Blank line right after the function definition must be removed A blank line right after the function definition must be removed Feb 20, 2022
@JelleZijlstra JelleZijlstra added the F: empty lines Wasting vertical space efficiently. label Feb 20, 2022
@felix-hilden
Copy link
Collaborator

Hi! Thanks for submitting. However, this is essentially the same as #902, so let's continue the discussion there!

@felix-hilden felix-hilden added the R: duplicate This issue or pull request already exists label Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: empty lines Wasting vertical space efficiently. R: duplicate This issue or pull request already exists T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

3 participants