Add 4 spaces (an extra level of indentation) to distinguish arguments from the rest.
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)
@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.
@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.