[Tutor] Looking to improve my stopWatch.py

John Fouhy john at fouhy.net
Thu Oct 25 06:41:50 CEST 2007


On 25/10/2007, Dick Moores <rdm at rcblue.com> wrote:
>  I'm wondering about "if lapTimeFlag:". Following "The Zen of Python", by
> Tim Peters ("Explicit is better than implicit"), isn't "if lapTimeFlag ==
> True" preferable?

No :-)

Otherwise, maybe we should make it even more explicit:

  if (lapTimeFlag == True) == True:

...but that still requires the reader to understand that the body of
the if: block will only execute if ((lapTimeFlag == True) == True) ==
True..

(hmm, reminds me of Lewis Carroll's modus ponens paradox)

-- 
John.


More information about the Tutor mailing list