GNU bug report logs -
#63959
python-mode does not keep indentation in square brackets []
Previous Next
Full log
View this message in rfc822 format
Andreas Röhler wrote:
> Thanks for your explanation, which makes me better understand your
> endeavour. A question remains: is this new feature worth that possibly
> raise of complexity? Your patch provides a higher degree of freedom
> while keeping regularity - which is a pro.
I think it is natural for many people to indent the same as the
previous line. In fact, it is standard behavior outside the parens.
For example, if you intentionally change the indentation of the first
line of a block, the following lines will have the same indentation:
def func():
a = 1 # Intentionally changed.
b = 2 # Same indent as previous line
You can even do the following, although it will result in an
IndentationError when executed:
def func():
a = 1
b = 2 # Intentionally changed.
c = 3 # Same indent as previous line
If inside the parens, the following will not result in an
IndentationError:
a = (
1,
2, # Intentionally changed.
3) # Same indent as previous line
So I rather think the rule of indenting the same as the previous line
is more useful inside parens.
I would consider making the indentation the same as the previous line
inside the parens a fix rather than a new feature. This is why I
named the commit "Fix Python indentation of continuation lines within
parens."
This bug report was last modified 2 years and 11 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.