Python style guidelines
aahz at pythoncraft.com
Thu Mar 11 17:27:51 CET 2004
In article <405035a3$1 at pfaff2.ethz.ch>,
Josef Meile <jmeile at hotmail.com> 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 pythoncraft.com) <*> http://www.pythoncraft.com/
"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