mk wrote:

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

or

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


I would vote for the first one. But I could use the second as well, I would'nt fight for it.

What is worrying me the most in your code sample is that self.cmd can hold diferrent types (str, and something else). That is usually a bad thing to do (putting None aside). However, my remark could be totally irrelevant of course, that depends on the context.

JM

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to