Menu

#13 add warning "if foo:"

open
nobody
None
5
2002-03-15
2002-03-15
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


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.