ipython / ipython/traitlets

using traitlets.config.get_config() in python config file breaks load_config_file

オープン
#379 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
653
フォーク
217
平均マージ
2日 21時間
マージ済み PR(30日)
2

説明

I put these lines at the top of a python config file:

from traitlets.config import get_config

c = get_config()

I did this so my editor would stop bugging me about c or get_config not being defined.

Unfortunately, this subtly broke load_config_file, because that sets up global with `get_config` and `c`, both of which I just accidentally destroyed.

I suggest that in the comments that are automatically generated when generate_config_file is used, a very explicit warning be placed to guard against this. Or perhaps there's some way to check if get_config or c has been mangled/modified accidentally

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。