which

Gerald Britton gerald.britton at gmail.com
Fri Feb 5 11:06:52 EST 2010


[snip]

> 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