From ed1bb245be4e7798f357b5eb19647d5b6f22599f Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Wed, 2 Sep 2026 22:31:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Drop=20dead=20`library`=20parame?= =?UTF-8?q?ter=20from=20`Splitter.split()`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since #603, `parse_string` builds a fresh `Library` and merges the result instead of handing the caller's library to the splitter, so nothing in the package (or the tests, docs or README) passes `library=` to `Splitter.split()` any more. Removing it rather than keeping an unused public parameter, while 2.0.0 is still unreleased (2.0.0b9). `split()` now always returns a new `Library`; the `Splitter` class and `split()` itself stay public. Co-Authored-By: Claude Opus 5 --- bibtexparser/splitter.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/bibtexparser/splitter.py b/bibtexparser/splitter.py index bbc3e97..59f9c34 100644 --- a/bibtexparser/splitter.py +++ b/bibtexparser/splitter.py @@ -275,22 +275,17 @@ def _move_to_end_of_entry(self, first_key_start: int) -> tuple[list[Field], int, end_index=after_field_mark.start(), ) - def split(self, library: Library | None = None) -> Library: - """Split the bibtex-string into blocks and add them to the library. + def split(self) -> Library: + """Split the bibtex-string into blocks and return them as a new library. - Args: - library: The library to add the blocks to. If None, a new library is created. Returns: - The library with the added blocks. + A new library containing the split blocks. """ self._markiter = re.finditer( r"(?