-
-
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
A false positive for C416 #204
Comments
My current fix is to create a 2-tuple factory function: def _as_tuple(a: _T, b: _TT) -> Tuple[_T, _TT]:
return (a, b) |
C416 currently assumes an iterable using unpacking is an iterable of tuples, which your example proves is not always the case. I'll remove the unpacking path of it. |
adamchainz
added a commit
that referenced
this issue
Nov 20, 2019
adamchainz
added a commit
that referenced
this issue
Nov 20, 2019
Fix released in version 3.1.4: https://pypi.org/project/flake8-comprehensions/3.1.4/ |
That's some seriously impressive turnaround time....many thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I saw some fixes were committed for C416 false positives before, and I believe I've found a new one.
I was working on some code, which converts a list of 2-element sequences to a list of 2-tuples:
Incidentally, the code passes if I create a 3-tuple instead:
Then I had this idea:
but that gave me a C409
Cheers
The text was updated successfully, but these errors were encountered: