pypi / traitlets
traitlets
What changed in traitlets 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-12.
8 breaking5 deprecations9 new APIs and options3 behavior and defaults1 tooling3 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inittraitlets 529 changes
Breaking changes 8
Python 3.10 is now required.
Python 3.9 is now required; Python 3.8 is no longer supported.
Traitlets no longer catches a number of BaseException subclasses.
Command-line parsing was rewritten to use argparse, changing behavior and allowing more flexibility in assigning literals without quoting.
Traitlets now provides a singular default method for declaring default values.
The container constructor parameter trait was renamed to value_trait.
Several previously exposed utility functions and types are no longer available, including ClassTypes, SequenceTypes, getargspec, and isidentifier.
The container constructor parameter traits was renamed to per_key_traits.
Deprecations 5
Deprecates the old CLong alias.
Deprecates the old Long alias.
The empty isidentifier utility is deprecated.
The old way of passing containers on the command line is deprecated and emits a warning.
Undefined is deprecated and emits a warning.
New APIs and options 9
Adds a trait for pathlib.Path values.
Aliases can have both short and long versions, and alias dictionary values can include a target and help string.
Applications expose the loaded configuration file list for long-running services.
A Callable trait was added for validating callable values.
A FuzzyEnum trait was added with case-insensitive matching and unique-prefix matching.
Dictionaries can restrict the type of their keys using the new key_trait parameter.
Link objects can be relinked after unlink has been called.
Link now accepts a transform attribute with inverse functions to control how values map between source and target.
Traits gained trait_has_value, which checks whether a value was assigned, excluding the default.
Behavior and default changes 3
Integer now accepts integer-valued numbers.
Definitions of K and V are no longer restricted to TYPE_CHECKING, making them available at runtime.
Subcommands can now be arbitrary callables and no longer need to subclass Application.
Tooling 1
The __new__ method now uses the Self type for improved type hinting.
Fixes and other changes 3
Re-added _merge to un-break Spyder temporarily.
Absolute paths passed with --config are loaded only once.
Fixed traitlets.__all__, correcting the names exposed through wildcard imports.