Python style guidelines

Aahz aahz at
Thu Mar 11 17:27:51 CET 2004

In article <405035a3$1 at>,
Josef Meile  <jmeile at> wrote:
>I agree, those are good guidelines, but I don't agree with:
>- Don't compare boolean values to True or False using == (bool
>   types are new in Python 2.3):
>         No:  if greeting == True:
>         Yes: if greeting:
>What would happened if you do:
> >>> a='test'
> >>> if a.find('foo'):
>...    print "foo was found"
>foo was found

>>> 'foo' in 'test'
Aahz (aahz at           <*>

"Do not taunt happy fun for loops. Do not change lists you are looping over."
--Remco Gerlich, comp.lang.python

More information about the Python-list mailing list