for arg in l:
key, val = arg.split('=')
if val == 'None': val = None
- if val == 'True': val = True
- if val == 'False': val = False
+ elif val == 'True': val = True
+ elif val == 'False': val = False
+ elif val.isdigit():
+ val = int(val)
+ else:
+ try:
+ val = float(val)
+ except ValueError: pass
d[key] = val
return d