Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
4 changes: 2 additions & 2 deletions src/dataclass_binder/_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand Down