| Summary: | Nested tuple unpacking shows "undefined variable" | ||
|---|---|---|---|
| Product: | [Developer tools] kdev-python | Reporter: | Todd <toddrme2178> |
| Component: | Language support | Assignee: | Sven Brauch <mail> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | tonal.promsoft |
| Priority: | NOR | ||
| Version First Reported In: | 1.4.0 / 1.4.1 (stable) | ||
| Target Milestone: | 1.4.0 | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
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. ;) Fixed in python3, not going to backport it to python2 though. *** Bug 330840 has been marked as a duplicate of this bug. *** |
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.