My intention is to have a default value for d even if the item (identified by key) is missing in adict.
d = QueryDict('')
try:
if adict['key'] is not None:
d = adict['key'].copy()
except KeyError:
pass
# use d ...
I cringe at the use of that exception handler. Did I violate any python code styles ?
This could be better:
It might not be obvious what that does, though, so this might be preferable: