[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42513: Python indentation bug when using multi-line on an if-conditi
From: |
Dale Sedivec |
Subject: |
bug#42513: Python indentation bug when using multi-line on an if-condition |
Date: |
Wed, 27 Jan 2021 12:20:32 -0600 |
On Jan 27, 2021, at 00:47, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> swedebugia <swedebugia@riseup.net> writes:
>
>> The following code indents correctly:
>> def fun(arg):
>> if(
>> args.suppliername == "x"):
>> #do something
>> else:
>> #do something
>>
>> The following code does not indent correctly:
>> def fun(arg):
>> if(
>> args.suppliername == "Messingschlager" or
>> args.suppliercodename == "MS"
>> ): #<- culprit
>> #do something
>> else: #<- this else is not possible to indent 1 tab
>> #do something
>
> I tried this in Emacs 26.1 and Emacs 28, and both seem to indent the
> same, or am I missing something?
If I use something other than a comment following the "if" statement line, I
can reproduce the original behavior in a master build from yesterday. For
example, replace "#do something" with "''" (an empty string) or just "bar".
(I am *guessing* the original reporter's code had at least one statement in the
"if" block. It's not valid syntax otherwise.)
Dale