Bug 314024

Summary: Nested tuple unpacking shows "undefined variable"
Product: [Developer tools] kdev-python Reporter: Todd <toddrme2178>
Component: Language supportAssignee: Sven Brauch <mail>
Status: RESOLVED FIXED    
Severity: normal CC: tonal.promsoft
Priority: NOR    
Version: 1.4.0 / 1.4.1 (stable)   
Target Milestone: 1.4.0   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Todd 2013-01-28 13:17:46 UTC
When trying to unpack nested tuples, kdev-python says the inner variables are undefined.  

Here is a simple example:

    a,(b,c)=(1,(2,3))

In this case you get "undefined variable: b" and  "undefined variable: c" problems

Here is a more practical example (mydict is a dictionary):

    for i,(key,value) in enumerate(mydict.iteritems()):
        pass

In this case you get "undefined variable: key" and "undefined variable: value" problems.

Both sets of code are valid in python 2 and python 3.
Comment 1 Sven Brauch 2013-01-28 13:21:43 UTC
Yeah, valid bug -- I did not implement it so far since it seemed a bit complicated to do correctly. I'll put it onto the todo list. ;)
Comment 2 Sven Brauch 2014-01-20 11:22:28 UTC
Fixed in python3, not going to backport it to python2 though.
Comment 3 Sven Brauch 2014-02-06 08:36:55 UTC
*** Bug 330840 has been marked as a duplicate of this bug. ***