-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive on C404 #194
Comments
Thanks. You should be able to use a generator to get around this for the time being In [1]: x = 'a=1;b=2'
In [2]: dict([i.split('=') for i in x.split(';')])
Out[2]: {'a': '1', 'b': '2'}
In [3]: dict((i.split('=') for i in x.split(';')))
Out[3]: {'a': '1', 'b': '2'} |
adamchainz
added a commit
that referenced
this issue
Nov 13, 2019
adamchainz
added a commit
that referenced
this issue
Nov 13, 2019
Released in 3.1.0: https://pypi.org/project/flake8-comprehensions/3.1.0/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a block of code that looks like:
This is being marked as C404: unnecessary list comprehension.
However, I don't believe it's possible to use a single dict comprehension to perform this.
(I'm not saying it's great code, btw...)
The text was updated successfully, but these errors were encountered: