#13 add warning "if foo:"

open
nobody
None
5
2002-03-15
2002-03-15
Evelyn Mitchell
No

if foo: is ambiguous for all but simple types
(see http://www.python.org/doc/current/lib/truth.html\)

This should be added as a warning with the suggested
change being:

if foo is not None:
or
if foo =! None:

See the thread "Python documentation and default
expression" in
http://lists.community.tummy.com/mailman/listinfo/frpythoneers
for the inspiration for this.

Discussion