GNU bug report logs - #42513
Python indentation bug when using multi-line on an if-condition

Previous Next

Package: emacs;

Reported by: swedebugia <swedebugia <at> riseup.net>

Date: Fri, 24 Jul 2020 09:41:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dale Sedivec <dale <at> codefu.org>
Cc: swedebugia <swedebugia <at> riseup.net>, 42513 <at> debbugs.gnu.org
Subject: bug#42513: Python indentation bug when using multi-line on an if-condition
Date: Thu, 28 Jan 2021 05:55:51 +0100
[Message part 1 (text/plain, inline)]
Dale Sedivec <dale <at> codefu.org> writes:

> 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".

Indeed:

def fun(arg):
    if(                                                     
            args.suppliername == "x"):
        foo
    else:
        foo

def fun(arg):
    if(                                                   
            args.suppliername == "Messingschlager" or          
            args.suppliercodename == "MS"
    ):
        foo
else:
    foo

[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]

> (I am *guessing* the original reporter's code had at least one
> statement in the "if" block.  It's not valid syntax otherwise.)

However, both these examples indent the same for me in Emacs 26.1 and
Emacs 28 (wrong in the same way), so I'm still not seeing what the
original reporter is seeing?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

This bug report was last modified 4 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.