-
Notifications
You must be signed in to change notification settings - Fork 2k
Formatter: Specify indentation for function parameters #8360
Copy link
Copy link
Open
Labels
formatterRelated to the formatterRelated to the formatterstyleHow should formatted code lookHow should formatted code look
Description
The current indentation behavior for function parameters is: 4-space indentation at function definitions, like this:
def my_function(
my_function_arg_1,
my_function_arg_2,
my_function_arg_3,
my_function_arg_4,
):
pass
This leads to reduced readability, because the function name and the argument names become harder to distinguish.
Adding one more level of indentation greatly improves readability:
def my_function(
my_function_arg_1,
my_function_arg_2,
my_function_arg_3,
my_function_arg_4,
):
pass
PEP8 also has the same suggestion: https://peps.python.org/pep-0008/#indentation
Originally posted by @jsh9 in #7310 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
formatterRelated to the formatterRelated to the formatterstyleHow should formatted code lookHow should formatted code look