diff --git a/README.md b/README.md index 761a144..f9962a5 100644 --- a/README.md +++ b/README.md @@ -598,3 +598,8 @@ In version 0.3.0, the function `format_template()` has been replaced by the meth ### 0.3.4 - 2023-08-18: - Support `pathlib.Path` as a field annotation ([#40](https://github.com/ProtixIT/dataclass-binder/issues/40)) + +### 0.3.5 - 2025-11-25: + +- Support TOML formatting with a non-empty context ([#52](https://github.com/ProtixIT/dataclass-binder/pull/52)) +- Ignore class-level constants that are not strings when looking for field docstrings ([e18818cb](https://github.com/ProtixIT/dataclass-binder/commit/e18818cb)) diff --git a/src/dataclass_binder/_impl.py b/src/dataclass_binder/_impl.py index 1ff5324..6ef6cb6 100644 --- a/src/dataclass_binder/_impl.py +++ b/src/dataclass_binder/_impl.py @@ -436,7 +436,7 @@ def _bind_to_class(self, toml_dict: Mapping[str, Any], instance: T | None, conte else: return replace(instance, **parsed) # type: ignore[type-var] - def format_toml(self, context: str = "") -> Iterator[str]: + def format_toml(self, *, context: str = "") -> Iterator[str]: """ Yield lines of TOML text for populating the dataclass or object that we are binding to. @@ -451,7 +451,7 @@ def format_toml(self, context: str = "") -> Iterator[str]: return self._format_toml_root(context=context, template=False) - def format_toml_template(self, context: str = "") -> Iterator[str]: + def format_toml_template(self, *, context: str = "") -> Iterator[str]: """ Yield lines of TOML text as a template for populating the dataclass or object that we are binding to.