Gerald Britton gerald.britton at gmail.com
Fri Feb 5 17:06:52 CET 2010


> Last August [1], I offered this alternative:
>  self.cmd = (cmd.replace(r'${ADDR}',ip)
>              if isinstance(cmd, str) else
>              cmd)
> But it didn't get much love in this forum!

I'd probably go for that one as well though I might consider removing
the outer parentheses.

Gerald Britton

More information about the Python-list mailing list