Re: Null String Variable

2005-05-16 Thread Steve Holden
Sean McIlroy wrote: > 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 > You would write this if there was a possibility that msg could be something other than a string, whose valu

Re: Null String Variable

2005-05-16 Thread Peter Hansen
Sean McIlroy wrote: > well, somebody's already pointed out that bool(msg)==False iff msg==''. I may not have received the message yet, but if "iff" still means "if and only if", then that statement is wrong. There are, of course, about a dozen things for which bool(msg) is False when msg != '',

Re: Null String Variable

2005-05-16 Thread Sean McIlroy
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 -- http://mail.python.org/mailman/listinfo/python-list

Re: Null String Variable

2005-05-16 Thread Klaus Alexander Seistrup
Rotary wrote: > I want to say something like that: if msg is empty ...then do > something. So how can i figure that msg is empty string (no > character, msg = ''). #v+ if not msg: print 'msg is empty' #v- -- Klaus Alexander Seistrup Magnetic Ink, Copenhagen, Denmark http://magnetic-ink

Null String Variable

2005-05-16 Thread rotary
I have a variable that store a string (i.e. a variable name msg).I want to say something like that: if msg is empty ...then do something.So how can i figure that msg is empty string (no character, msg = '').Maybe a silly question but i have no programming experiense.Thanks, Leonidas -- http: