| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…t be paired with a break
Sorry, something went wrong.
|
Can you add the issue number to the title? |
Sorry, something went wrong.
| In either kind of loop, the :keyword:`!else` clause is **not** executed | ||
| if the loop was terminated by a :keyword:`break`. |
There was a problem hiding this comment.
We should keep this sentence. It underscores the semantics.
Sorry, something went wrong.
|
|
||
| In a :keyword:`for` loop, the :keyword:`!else` clause is executed | ||
| after the loop reaches its final iteration. | ||
| after the loop reaches its final iteration if no break occurred. |
There was a problem hiding this comment.
| after the loop reaches its final iteration if no break occurred. | |
| after the loop finishes its final iteration, that is, if no break occurred. |
I think this is clearer.
Sorry, something went wrong.
|
|
||
| A :keyword:`!for` or :keyword:`!while` loop can include an :keyword:`!else` clause. | ||
| The :keyword:`!break` statement may be paired with an :keyword:`!else` clause. | ||
| If the loop exits without executing the break, the else clause executes. |
There was a problem hiding this comment.
| If the loop exits without executing the break, the else clause executes. | |
| If the loop finishes without executing the break, the else clause executes. |
Sorry, something went wrong.
|
I've made a larger change to this section, including these changes, in #123946 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
📚 Documentation preview 📚: https://cpython-previews--123787.org.readthedocs.build/