{ } Raw JSON

bundles / traitlets latest / traitlets / config / configurable / SingletonScope

class

traitlets.config.configurable:SingletonScope

source: /traitlets/config/configurable.py:548

Signature

class SingletonScope(base: type[SingletonConfigurable]) → None

Members

Summary

An isolated singleton registry, activated for a dynamic extent.

Extended Summary

While active (with scope():), SingletonConfigurable.instance on any subclass of base resolves within this registry — creating fresh instances on first use — in the current thread/async task. Re-enterable: the registry persists across activations.

Scope SingletonConfigurable itself for a complete blank slate covering every singleton in the process.

Aliases

  • traitlets.config.SingletonScope

Referenced by

This package