|
From: Jason B. <jb...@ze...> - 2010-03-17 18:50:21
|
On Wed, Mar 17, 2010 at 1:35 PM, Michael Foord <fuz...@vo...>wrote:
> How about setdefault?
>
> >>> c = ConfigObj()
> >>> c['bar'] = 'baz'
> >>> c.setdefault('foo', '%(bar)s')
> 'baz'
>
> Michael
>
I'm assuming you mean using setdefault in lieu of my exception handling
which is a good idea. However, the exception block isn't really my primary
concern. It just feels a bit like I'm coupling my app a bit too closely to
Section's inner workings by going that route. I was thinking of something
more along the lines of a magical "get_by_interpolation" function (or
something that would make implementing such a function easier). But, if
such an animal doesn't exist, I suppose I'll just have to deal. :-)
|