which

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Fri Feb 5 17:07:52 CET 2010


mk a écrit :
> 
> if isinstance(cmd, str):
>     self.cmd = cmd.replace(r'${ADDR}',ip)
> else:
>     self.cmd = cmd

What could "cmd" be except a string ? From other posts here, I guess 
it's either a string or None ? If yes, then I'd go for this:

if cmd:
   cmd = cmd.replace(r'${ADDR}',ip)

self.cmd = cmd






More information about the Python-list mailing list