Loop until condition is true

Antoon Pardon apardon at forel.vub.ac.be
Thu Jun 23 06:05:53 EDT 2005


Op 2005-06-22, Michael Hoffman schreef <cam.ac.uk at mh391.invalid>:
> Remi Villatel wrote:
>> Fredrik Lundh wrote:
>>> checking if a logical expression is true by comparing it to True is bad
>>> style, and comparing values using "is" is also bad style.
>> 
>> I wrote it this way because, first, it's perfectly valid Python code and,
> > second and most important, it's also a valid english sentence.
>
> As others have pointed out, it's not perfectly valid code. In fact it is 
> frequently incorrect.

That the same code would be incorrect in other circumstances doesn't
make it invalid as it was used in a specific situation.

I have written code my self with an "if var is True" statement and
that is exactly what I wanted. Replacing it with "if var" would
have broken the the program.

-- 
Antoon Pardon



More information about the Python-list mailing list