Bug 296118

Summary: Target variable in comprehensions isn't recognized if followed by attribute reference
Product: [Developer tools] kdev-python Reporter: Nicolás Alvarez <nalvarez>
Component: generalAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: mail
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Nicolás Alvarez 2012-03-16 00:54:15 UTC
In a list comprehension, if the target variable appears in the main expression followed by an attribute access, the target variable is not recognized.

Example: [foo.bar() for foo in somelist]

The first 'foo' is underlined in yellow.

This happens even if the attribute expression doesn't apply to this variable. For example:
[foo.bar(item) for item in lst] # this works
[foo(item).bar for item in lst] # this doesn't work
Comment 1 Sven Brauch 2012-03-16 19:54:09 UTC
Git commit 21aa5ca9d6cd4ddb3e2431fa5b2e526a8f5239e2 by Sven Brauch.
Committed on 16/03/2012 at 20:52.
Pushed by brauch into branch 'master'.

Fix a bug with generator ranges

The implementation of this really, really sucks... but I don't know of a better one. :(

M  +11   -4    duchain/contextbuilder.cpp
M  +1    -0    duchain/tests/pyduchaintest.cpp

http://commits.kde.org/kdev-python/21aa5ca9d6cd4ddb3e2431fa5b2e526a8f5239e2