[Python-ideas] If branch merging

Ethan Furman ethan at stoneleaf.us
Tue Jun 9 20:00:57 CEST 2015


On 06/07/2015 07:18 PM, Steven D'Aprano wrote:

> It's not like elif, which is uneffected by any previous if or elif
> clauses. Each if/elif clause is independent.

This is simply not true: each "elif" encountered is only evaluated if all the previous if/elif lines failed, so you have to pay attention to those previous lines to know if execution will even get 
this far.

>  The test is always made
> (assuming execution reaches that line of code at all),

Exactly.

--
~Ethan~


More information about the Python-ideas mailing list