__init__.py 938 B

1234567891011121314151617181920212223242526272829303132333435
  1. """Traitlets Python configuration system"""
  2. from __future__ import annotations
  3. import typing as _t
  4. from . import traitlets
  5. from ._version import __version__, version_info
  6. from .traitlets import *
  7. from .utils.bunch import Bunch
  8. from .utils.decorators import signature_has_traits
  9. from .utils.importstring import import_item
  10. from .utils.warnings import warn
  11. __all__ = [
  12. "traitlets",
  13. "__version__",
  14. "version_info",
  15. "Bunch",
  16. "signature_has_traits",
  17. "import_item",
  18. "Sentinel",
  19. ]
  20. class Sentinel(traitlets.Sentinel): # type:ignore[name-defined, misc]
  21. def __init__(self, *args: _t.Any, **kwargs: _t.Any) -> None:
  22. super().__init__(*args, **kwargs)
  23. warn(
  24. """
  25. Sentinel is not a public part of the traitlets API.
  26. It was published by mistake, and may be removed in the future.
  27. """,
  28. DeprecationWarning,
  29. stacklevel=2,
  30. )