ipython / ipython/ipython

%config can't configure PlainTextFormatter

Open
#11,604 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
16.8k
Forks
4.5k
Avg merge
1d 2h
Merged PRs (30d)
6

Description

I'm trying to (re-)configure PlainTextFormatter using %config, but it doesn't take.

Looking through the code, `%config` creates a new config object and updates each object in `get_ipython().configurables`. This does not include PlainTextFormatter. DisplayFormatter, which owns PlainTextFormatter, does exist and will be reconfigured, however it does nothing to propagate the changes to PlainTextFormatter or any of the other formatters.

During initialization this is not a problem because any of the formatters will take DisplayFormatter as parent Configurable and copy the reference to the config object.

It would be nice to be able to configure PlainTextFormatter from `%config`. Either simply including PlainTextFormatter in `.configurables` or by making DisplayFormatter directly reconfigure it when it itself is reconfigured, or possibly by making PlainTextFormatter observe the config trait on its parent, however that would seem to be something that belongs in the traitlets library.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.