[Tutor] Code critique

Bo Morris crushed26 at gmail.com
Fri Oct 24 20:50:09 CEST 2014


"...Regarding your program, instead of writing long sequences of repetitive
if
conditions, I would write one function for each of the different operations
and store them in a dict, mapping each host name to a function (and
multiple host names may map to the same function). Then, look up the host
name in the dict and call the corresponding function to run the right
operations on that host..."

Thank you Stefan for your input. Would please be willing to provide an
example?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20141024/1647384b/attachment.html>


More information about the Tutor mailing list