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

Add 4 spaces (an extra level of indentation) to distinguish arguments from the rest. #65

Open
parkershamblin opened this issue Aug 4, 2020 · 2 comments

Comments

@parkershamblin
Copy link

parkershamblin commented Aug 4, 2020

See PEP8 Indentation for example.

Minimal code example:

What I want the code to look like after pressing enter:

# Add 4 spaces (an extra level of indentation) to distinguish arguments from the rest.
def long_function_name(
        var_one, var_two, var_three,
        var_four):
    print(var_one)

What the code actually looks like after pressing enter:

def long_function_name(
    var_one, var_two, var_three,
    var_four):
    print(var_one)
@kbrose
Copy link
Owner

kbrose commented Aug 25, 2020

@parkershamblin where are your cursors in the above? Please be very explicit in how you created such a situation -- my issue template includes a "What the code looks like before pressing enter" section which you seem to have deleted, but is crucial for reproducibility. When I try to replicate this, I end up with the following steps:

# Step 1
def long_function_name(|)

# Step 2, press Enter
def long_function_name(
    |
)

# Step 3, adding arguments
def long_function_name(
    var_one, var_two, var_three,
    var_four
):|

# Step 4, press Enter
def long_function_name(
    var_one, var_two, var_three,
    var_four
):
    |

# Step 5, complete
def long_function_name(
    var_one, var_two, var_three,
    var_four
):
    print(var_one)|

I'll admit this doesn't show up in PEP8, but it is at least very clear which code belongs to the function definition vs. the function code.

@parkershamblin
Copy link
Author

parkershamblin commented Aug 28, 2020

@kbrose I apologize for not including a "What the code looks like before pressing enter" section in my post. I believe that I accidentally deleted it while writing the post, but yes, the steps you listed are exact the steps I took.

Personally, I think the format of the code being generated is fine and easily readable. As you mentioned, it's clear which code belongs to the function definition vs. the function code.

If it is going a hassle to try and change it to match PEP8, I would not worry about it. I created this issue with the intent of it acting as a friendly notification to the contributors that this small difference existed, and not as an actual "issue" that must be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants