On 06/27/11 09:23, Drew Fisher wrote:
Harold:
1042-1056: Don't use try/except as a control structure. Explicitly check
for the keys:
if PROP_BOOT_FILE in serv:
info['boot_file'] = serv.get(PROP_BOOT_FILE)
if PROP_DEF_MANIFEST in serv:
info['default-manifest'] = serv.get(PROP_DEF_MANIFEST)
if PROP_VERISON in serv:
info['version'] = serv.get(PROP_VERSION)
Note, I'm using serv.get() but you can also use serv[KEY]. Makes no
difference to me.
Otherwise, this looks fine.
Indeed; using the get() is a bit silly if you're going to check for the
presence of a key anyway since get() will return None by default if the
key doesn't exist in the dict.
-Shawn
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss