ipython / ipython/traitlets

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

Đang mở
#379 4 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
653
Fork
217
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
2

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.