unstale

pypi / omegaconf

omegaconf

What changed in omegaconf 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-13.

23 breaking4 deprecations20 new APIs and options2 performance11 behavior and defaults18 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.0 on npm

omegaconf 278 changes

Breaking changes 23

  • DictConfig and ListConfig are unhashable and cannot be used as dictionary keys or set elements.

    2.4.0release notes

  • OmegaConf.create(None) returns literal None instead of a DictConfig(None) wrapper.

    2.4.0release notes

  • Returns NoneType for OmegaConf nodes containing None and validates None/NoneType annotations.

    2.4.0release notes

  • Use is_tuple for tuple-specific behavior; is_sequence accepts either sequence type.

    2.4.0release notes

  • Raises InterpolationToMissingValueError when an interpolation dereferences to a missing value instead of silently overwriting the node with ???.

    2.4.0release notes

  • Raises ConfigTypeError with a clear message when navigating through a structured Optional node that is None, rather than AssertionError.

    2.4.0release notes

  • Integer interpolation segments and integer-looking string paths can resolve integer dictionary keys; configurations reject ambiguous pairs such as 1 and "1".

    2.4.0release notes

  • Python 3.10 or newer is required; support for Python 3.6 through 3.9 has been dropped.

    2.4.0release notes

  • Native tuples now create a structurally immutable TupleConfig instead of a mutable ListConfig; tuple semantics are experimental.

    2.4.0release notes

  • Lazy access now validates and converts interpolated values against their destination type, matching eager resolution.

    2.4.0release notes

  • Alias expansion is limited by default to avoid excessive config growth from crafted YAML input, with an environment override for trusted configurations.

    2.4.0release notes

  • pretty() preserves insertion order by default instead of sorting keys; set sort_keys=True to override.

    2.0.0release notes

  • Deleting an item raises ConfigTypeError when the config is in struct mode.

    2.0.0release notes

  • pop now returns the underlying value rather than a ValueNode.

    2.0.0release notes

  • pop() raises ConfigTypeError when the config is in struct mode.

    2.0.0release notes

  • cfg.save() was removed; use OmegaConf.save().

    2.0.0release notes

  • cfg.to_container() was removed; use OmegaConf.to_container().

    2.0.0release notes

  • Merging into a node interpolation now copies the target node by value.

    2.0.0release notes

  • omegaconf.Config was renamed to omegaconf.Container.

    2.0.0release notes

  • select(key) returns the root node when key is an empty string.

    2.0.0release notes

  • Support for Python 2.7 and Python 3.5 was dropped.

    2.0.0release notes

  • Invalid access in struct mode raises Python-consistent exceptions: KeyError for dictionary-style missing-key access and AttributeError for attribute-style missing-attribute access.

    2.0.0release notes

  • Automatic conversion of date strings during YAML decoding is disabled.

    2.0.0release notes

Deprecations 4

  • Direct assignment and typed-container mutation warn when implicitly converting a value to another type; use OmegaConf.update for explicit conversion.

    2.4.0release notes

  • Deprecated in favor of OmegaConf.register_resolver as the canonical custom resolver API.

    2.4.0release notes

  • cfg.select(key) is deprecated in favor of OmegaConf.select(cfg, key).

    2.0.0release notes

  • cfg.update(key, value) is deprecated in favor of OmegaConf.update(cfg, key, value).

    2.0.0release notes

New APIs and options 20

  • Can validate runtime arguments and return values against annotations using off, warn, or error policies; the default is advisory warnings.

    2.4.0release notes

  • DictConfig supports | for a new merged config and |= for an in-place merge; ListConfig does not support these operators.

    2.4.0release notes

  • Explicitly converts values using OmegaConf primitive node types before destination validation.

    2.4.0release notes

  • Checks whether a select-style key path can produce a value without returning a default or raising.

    2.4.0release notes

  • Compares configs by unresolved container structure.

    2.4.0release notes

  • Accepts default_flow_style to control YAML collection flow style.

    2.4.0release notes

  • Provides explicit container typing for disambiguating assignments to unions of typed container types.

    2.4.0release notes

  • Structured config types can be union members, selected by type, with ambiguous mappings handled explicitly.

    2.4.0release notes

  • Structured configs support unions of typed container types, with explicit container typing available for ambiguous assignments.

    2.4.0release notes

  • Structured configs support Literal annotations, including Literal members of unions.

    2.4.0release notes

  • ListConfig implements typing.MutableSequence.

    2.0.0release notes

  • Tests whether an object is an OmegaConf object.

    2.0.0release notes

  • Tests whether an object is an OmegaConf dict.

    2.0.0release notes

  • Queries whether a node is an interpolation.

    2.0.0release notes

  • Tests whether an object is an OmegaConf list.

    2.0.0release notes

  • Tests whether a config key or node is missing, with value '???'.

    2.0.0release notes

  • Queries whether a node represents None.

    2.0.0release notes

  • Queries whether a config node is optional and can take None.

    2.0.0release notes

  • Config files can be loaded and saved using pathlib.Path objects.

    2.0.0release notes

  • Structured Configs let you create OmegaConf objects from dataclasses, attr classes, or objects; OmegaConf retains type information and validates config mutations.

    2.0.0release notes

Performance 2

  • Uses yaml.CDumper instead of yaml.Dumper whenever possible to speed up dumping.

    2.4.0release notes

  • Uses yaml.CSafeLoader instead of yaml.SafeLoader whenever possible to speed up parsing.

    2.4.0release notes

Behavior and default changes 11

  • Supported in Union annotations; transparent PEP 695 type aliases are also supported.

    2.4.0release notes

  • Escaped literal ??? values are supported across interpolation, resolvers, and YAML; plain ??? returned by a resolver is missing on access.

    2.4.0release notes

  • Key paths in update, select, from_dotlist, and from_cli support backslash escaping for literal dots, brackets, and equals signs.

    2.4.0release notes

  • Missing-key errors suggest similar key names when any exist.

    2.4.0release notes

  • Can address keys containing literal dots, brackets, colons, or backslashes.

    2.4.0release notes

  • Undeprecated as the canonical custom resolver API; register_new_resolver and legacy_register_resolver are deprecated.

    2.4.0release notes

  • Structured configs accept string-valued enum assignments using either the enum member name or its value.

    2.4.0release notes

  • Structured configs can inherit from Dict, allowing arbitrary fields.

    2.0.0release notes

  • DictConfig implements typing.MutableMapping.

    2.0.0release notes

  • Enums can now be used as config values and keys.

    2.0.0release notes

  • Exception messages are standardized.

    2.0.0release notes

Fixes and other changes 18

  • Iteration over List[Union[...]] yields selected concrete values rather than UnionNode wrappers, matching indexing.

    2.4.0release notes

  • Negative list-index interpolations and negative slicing edge cases now behave more like Python lists.

    2.4.0release notes

  • Follows Python list semantics for negative and out-of-range indices and leaves the list unchanged when validation fails.

    2.4.0release notes

  • Supports collections.OrderedDict as both a top-level input and a nested value.

    2.4.0release notes

  • Works with nested readonly structured configs and no longer fails when merging into a null dictionary root, including optional Structured Config fields.

    2.4.0release notes

  • Adds a resolve_custom_resolvers flag to opt into custom resolver evaluation while handling missing values dereferenced by interpolations.

    2.4.0release notes

  • No longer raises UnsupportedValueType when a custom resolver returns a dict or list.

    2.4.0release notes

  • Resolves nested interpolations in resolver-returned containers in one call, including when another field refers to the container before its field is visited.

    2.4.0release notes

  • Integer interpolation segments and integer-looking string paths can resolve integer dictionary keys; configurations reject ambiguous pairs such as 1 and "1".

    2.4.0release notes

  • Returns the provided default when a relative key climbs above the config root.

    2.4.0release notes

  • With resolve=True, each custom resolver is evaluated at most once per conversion pass, matching OmegaConf.resolve behavior for these cases.

    2.4.0release notes

  • No longer crashes when merging structured configs containing union types.

    2.4.0release notes

  • Follows intermediate node interpolations to existing config containers, applying nested updates to the referenced container while preserving the interpolation.

    2.4.0release notes

  • Fixes source installs with setuptools versions that no longer provide pkg_resources.

    2.3.1release notes

  • pretty() handles strings containing Unicode characters correctly.

    2.0.0release notes

  • Accessing a config in struct mode with get() and a None default no longer raises AttributeError.

    2.0.0release notes

  • Equality no longer fails when an object contains unresolvable values.

    2.0.0release notes

  • Indirect access to a missing value correctly raises MissingMandatoryValue.

    2.0.0release notes