[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#34268: 27.0.50; wrong indentation in python mode
From: |
Lars Ingebrigtsen |
Subject: |
bug#34268: 27.0.50; wrong indentation in python mode |
Date: |
Fri, 24 Sep 2021 00:01:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Augusto Stoffel <arstoffel@gmail.com> writes:
> I have no idea about what strong opinions other people may have here,
> but after looking a bit into this I think 1 is probably a better default
> for `python-indent-def-block-scale'. Here's what I found out:
>
> The current default of 2 for `python-indent-def-block-scale' is meant to
> produce this indentation style
>
> ```
> def long_function_name(
> var_one, var_two, var_three,
> var_four):
> print(var_one)
> ```
>
> which is exactly as one can find in PEP-8. Setting it to 1 produces
>
> ```
> def long_function_name(
> var_one, var_two, var_three,
> var_four):
> print(var_one)
> ```
>
> which is deemed wrong in that document.
So it sounds like we need a different solution than just altering
block-scale, because it'd be nice if that continued to work, even if:
> However, the above formatting looks quite unfamiliar to me anyway. I
> usually see one of the following styles:
>
> ```
> # By far the most common style in the Python source, and, I, think, the
> # default style of YAPF
> def long_function_name(var_one, var_two, var_three,
> var_four):
> print(var_one)
> ```
Yeah, that looks more normal.
> Finally, the situation mentioned originally in this bug report seems to
> be a glitch: an indentation rule that makes sense in a "for" statement
> is being applied where a "for" appears in a list comprehension. It's a
> rather minor detail, I'd say.
Right.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no