which

mk mrkafk at gmail.com
Fri Feb 5 17:34:13 CET 2010


Bruno Desthuilliers wrote:
>> if cmd:
>>     self.cmd = cmd.replace..
> 
> And what if cmd happens to be the empty string ?-)
> 
> ok, me --->[]

Right, I didn't think much when I wrote that. Anyway, that's back to 
square one.

I will probably go for this anyway:

         assert isinstance(cmd, basestring) or cmd is None, 'cmd has to 
be string or None'
         if cmd:
             cmd = cmd.replace(r'${ADDR}',ip)
         self.cmd = cmd




More information about the Python-list mailing list