Bug 296118 - Target variable in comprehensions isn't recognized if followed by attribute reference
Summary: Target variable in comprehensions isn't recognized if followed by attribute r...
Status: RESOLVED FIXED
Alias: None
Product: kdev-python
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-16 00:54 UTC by Nicolás Alvarez
Modified: 2012-03-16 19:54 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 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