You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically if you create a singleton via its constructor it does not check for other instances.
This is problematic as Applications are SingletonConfigurable and can have subapps, so inherently traitlets is unsound. The order in which you create those will change the result of Application.instance() I believe.
The text was updated successfully, but these errors were encountered:
Singletons are not strictly enforced - you can have many instances of a given singleton class, but the instance() method will always return the same one.
I'm not sure about the ordering issue, normally SubApp.instance() would raise if another subapp is already instantiated. See for example related discussion in #474 and the (inactive) PR which aims to handles the case of a non-singleton subcommand.
Edit: I do agree the docs could use further clarification on this, it definitely is a bit confusing and the docstring for SingletonConfigurable is misleading as per the current design. But I think trying to change Application.__init__() to be truly a singleton would break a significant amount of downstream code.
See ipython/ipython#14006
Basically if you create a singleton via its constructor it does not check for other instances.
This is problematic as Applications are SingletonConfigurable and can have subapps, so inherently traitlets is unsound. The order in which you create those will change the result of
Application.instance()
I believe.The text was updated successfully, but these errors were encountered: