[Tutor] what is the difference

Tiger12506 keridee at jayco.net
Thu Dec 13 21:52:44 CET 2007


> "johnf" <jfabiani at yolo.com> wrote
>
>> if self._inFlush:
>>       return
>> self._inFlush = True
>> ....
>>
>> AND
>>
>> if not self._inFlush:
>>      ...
>>     self._inFlush = True
>> else:
>>     return
>>
>> I can not see the difference but the second one acts differently in
>> my code.
>
> The first has no else clause so the second assignment always happens.
>
> Alan G.

No it doesn't. The return statement does not allow the second assignment to 
occur in the first example. The second assignment only occurs if NOT 
(self._inFlush==True), as in the second example.



More information about the Tutor mailing list