In message <mailman.2506.1246557392.8015.python-l...@python.org>, Zach Hobesh wrote:
> I want to be able to look at the value and determine what type it > SHOULD be. Right now, configs['overwrite'] = 'true' (a string) when > it might be more useful as a boolean. Typically the type should be what you expect, not what is given. For example, it doesn't make sense for your configs["overwrite"] setting to be "red", does it? A reasonable solution might be to have a table of expected types for each config item keyword, e.g. configs_types = \ { ... "overwrite" : lambda x : x[0] not in set("nNfF"), ... } Then you can just do something like configs[keyword] = configs_types[keyword](configs[keyword]) with appropriate trapping of ValueError exceptions. -- http://mail.python.org/mailman/listinfo/python-list