-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Rewrite six.PY2 ternary #162
Comments
I'd probably implement this as two steps, one to replace |
@asottile here's a tool that does automatic dead code removal: coala/coala-bears#2000 |
@graingert note that this is already done for
the detection part is simple, the "finding the end and beginning of the ternary expression" is hard |
it seems they've managed to get it to apply removals to dead code detections jendrikseipp/vulture#25 |
cool, but it doesn't help us here |
Hm... The trickiest part is to rewrite: 3 if six.PY3 else 2 to 3 |
I think they're both nearly impossible given we don't properly know expression boundaries (though maybe the new python3.8 stuff helps?) |
I wonder if PEP 657 might help with this? (It makes reference to branch differentiation in ternary statements w.r.t. coverage.) |
it does not help, we are not running code |
Of course. 🤦🏻♂️ Sorry for the noise. 🙂 |
this one is going to be quite tricky I imagine
The text was updated successfully, but these errors were encountered: