Greg Ewing wrote: > Fuzzyman wrote: > > >> cfg = ConfigObj(newfilename) >> cfg['key'] = 'value' >> cfg['key2'] = ['value1', 'value2', 'value3'] >> cfg['section'] = {'key': 'value', 'key2': ['value1', 'value2', 'value3']} >> > > If the main purpose is to support this kind of notational > convenience, then I'd be inclined to require all the values > used with this API to be concrete strings, lists or dicts. > If you're going to make types part of the API, I think it's > better to do so with a firm hand rather than being half- > hearted and wishy-washy about it. > [snip..] > Thanks, that's the solution we settled on. We use ``isinstance`` tests to determine types. The user can always do something like : cfg['section'] = dict(dict_like_object) Which isn't so horrible. All the best, Michael > -- > Greg > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-dev/attachments/20060222/abd30a28/attachment.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4