well, somebody's already pointed out that bool(msg)==False iff msg==''. i'm curious to know what's wrong with simply writing if msg=='': ## do_something