[IPython-dev] Small config puzzle

Min RK benjaminrk@gmail....
Sun Jun 3 15:37:38 CDT 2012



-MinRK

On Jun 3, 2012, at 1:11 PM, Fernando Perez <fperez.net@gmail.com> wrote:

> On Sun, Jun 3, 2012 at 12:00 PM, MinRK <benjaminrk@gmail.com> wrote:
>> The Config file has no idea that rc is a dict (or that rc is an option at
>> all).
>> 
>> The only thing you can do in config files is assignment:
>> 
>> c.InlineBackend.rc = {'savefig.dpi': 96}
>> 
>> Traitlets are not involved at all in the config files or the construction of
>> the config object, they determine how the config object (after it is
>> constructed by config files and command-line opts) is interpreted.
> 
> Ah, understood.  Then the next question is: will the default rc object
> be overridden or updated with these values?

Overridden. The only thing you can do in config is simple attribute assignment. It doesn't do anything fancy, so c.InlineBackend.rc = foo is the same as doing the actual assignment to the real object.

I don't know if you recall, but we discussed an API in your office to address this sort of thing for container traits, where we had an idea like:

c.InlineBackend._rc_update = dict(foo=bar)

for dicts or 

c.Foo._bar_extend = [more, entries]

for lists. 


> 
> Cheers,
> 
> f
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev


More information about the IPython-dev mailing list