local variable referenced before assignment

Tim Williams tdwdotnet at gmail.com
Thu Oct 25 09:01:13 EDT 2007


On 25/10/2007, A.T.Hofkamp <hat at se-162.se.wtb.tue.nl> wrote:
> On 2007-10-25, Pete Bartonly <none at try.invalid> wrote:
> >
> Also, brackets around conditions (in the if) are not needed, and comparing
> against None is usually done with 'is' or 'is not' instead of '==' or '!='.
> The result is then
>
> if logMsg is not None:

Or just

>>>  if logMsg:
            do_something()

:)



More information about the Python-list mailing list