Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions traitlets/config/configurable.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,15 @@ def _load_config(
) -> None:
"""load traits from a Config object"""

my_config = self._find_my_config(cfg)
if not my_config:
# Nothing in the config applies to this instance; avoid the cost of
# computing traits() and entering hold_trait_notifications() for the
# many leaf Configurables that carry no matching config.
return

if traits is None:
traits = self.traits(config=True)
if section_names is None:
section_names = self.section_names()

my_config = self._find_my_config(cfg)

# hold trait notifications until after all config has been loaded
with self.hold_trait_notifications():
Expand Down
Loading