GNU bug report logs -
#24809
25.1; Python.el improper indention after backslash-assignment-continuation
Previous Next
Reported by: Jules Tamagnan <jtamagnan <at> gmail.com>
Date: Thu, 27 Oct 2016 22:04:01 UTC
Severity: minor
Tags: fixed, patch
Found in version 25.1
Fixed in version 26.1
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
[Please use "Reply All" to keep 24809 <at> debbugs.gnu.org on Cc]
[Message part 2 (message/rfc822, inline)]
npostavs <at> users.sourceforge.net writes:
> Jules Tamagnan <jtamagnan <at> gmail.com> writes:
>
>> The bug is quite simple.
>> - Open a python file.
>> - Type:
>> hello = \
>> - C-m ; newline
>>
>> The point will now be directly under the backslash character. This is
>> indented incorrectly according to the pep8 style guide and the
>> pycodestyle checker, it should instead be indented
>> `python-indent-offset` further than the previous line.
>
> So the patch works (additionally the python-indent-after-backslash-4
> test would need to be updated) but I'm not sure if it's correct.
> Currently, the pep8 style guide doesn't really say anything about
> indentation following backslash, it just recommends using parens
> instead.
I can update the test. Yeah it is a sort of gray zone because the style
guide isn't explicit. I think that the goal of putting a backslash after
the equal sign would be to split a line that was too long. The current
way that emacs chooses to split a line is not really consistent that
goal or with the outcome of using an open paren. I think that the
following long line:
an_overly_long_variable_name = some_object.some_method(some_argument_to_some_method)
could be split like this:
an_overly_long_variable_name = (
some_object.some_method(some_argument_to_some_method))
or if someone wanted to use a backslash like this:
an_overly_long_variable_name = \
some_object.some_method(some_argument_to_some_method)
instead of like:
an_overly_long_variable_name = \
some_object.some_method(some_argument_to_some_method)
This bug report was last modified 7 years and 356 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.