Bug 314024 - Nested tuple unpacking shows "undefined variable"
Summary: Nested tuple unpacking shows "undefined variable"
Status: RESOLVED FIXED
Alias: None
Product: kdev-python
Classification: Developer tools
Component: Language support (show other bugs)
Version: 1.4.0 / 1.4.1 (stable)
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.4.0
Assignee: Sven Brauch
URL:
Keywords:
: 330840 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-01-28 13:17 UTC by Todd
Modified: 2014-02-06 08:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***