Skip to content
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

for…else always reports missing branch #122

Closed
nedbat opened this issue Mar 16, 2011 · 3 comments
Closed

for…else always reports missing branch #122

nedbat opened this issue Mar 16, 2011 · 3 comments
Labels
branch bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Mar 16, 2011

Originally reported by Brandon Rhodes (Bitbucket: brandon, GitHub: brandon)


The attached program, which sends its "for" statement through every possible branch, nevertheless elicits a complaint from "coverage" that the "for" loop missed one of its possibilities. Apparently, "coverage" does not realize that a "for" loop with an "else" statement cannot result in immediately jumping to the end of the whole statement, skipping the "else".


@nedbat
Copy link
Owner Author

nedbat commented Jul 1, 2011

Original comment by Anonymous


It may be useful: is a non-iterable is given to the for construct, making it raise a TypeError (and thus jumping over), all branches are marked as executed.

@nedbat
Copy link
Owner Author

nedbat commented Jul 4, 2011

Fixed in <<changeset 434cba2ac7df (bb)>>. This fix also made "while 1" loops automatically understand that they can never jump to the end of the loop!

@nedbat nedbat closed this as completed Jul 4, 2011
@nedbat
Copy link
Owner Author

nedbat commented Sep 14, 2011

Original comment by Wichert Akkerman (Bitbucket: wichert, GitHub: wichert)


Issue #148 was marked as a duplicate of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant