Bug 323796

Summary: Incomplete support for nested function variable scoping
Product: [Developer tools] kdev-python Reporter: Antonis Kanouras <antonis+kdebugs>
Component: Language supportAssignee: Sven Brauch <mail>
Status: RESOLVED DUPLICATE    
Severity: normal CC: mail
Priority: NOR    
Version: 1.5.x   
Target Milestone: 1.6.0   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 5.2.0
Sentry Crash Report:

Description Antonis Kanouras 2013-08-20 19:03:54 UTC
def foo():
    def bar():
        baz

    baz = 1

In the above example, bar's baz gets a yellow underline with the tooltip stating: "Undefined variable: baz".

Package information:
ii  kdev-python                           1.5.1-0ubuntu1~ubuntu13.04~ppa2                    amd64        KDevelop Python Plugin
ii  kdevelop                              4:4.5.1-0ubuntu5~ubuntu13.04~ppa2                  amd64        integrated development environment for KDE
Comment 1 Sven Brauch 2016-06-13 07:09:09 UTC
The behaviour is correct, this is not valid python code.
Comment 2 Francis Herne 2017-08-31 01:34:18 UTC
Er...this is valid Python code, and our bug.

This will be fixed in 5.2, see the other report for details.

*** This bug has been marked as a duplicate of bug 378083 ***