The parameters are typed Iterable[Middleware], but _build_parse_stack consumes the iterable when computing append_stack_types before calling list(append_middleware) (bibtexparser/entrypoint.py:36-45; same pattern in _build_unparse_stack, lines 66-75). A generator/iterator therefore results in an empty middleware list — silently.
lib = bibtexparser.parse_string("@article{x, month = {3}}",
append_middleware=iter([MonthIntMiddleware()]))
lib.entries[0]["month"] # '3' -- middleware was never applied
Fix: materialize to a list at the top of the builders (or type the params as List).
The parameters are typed
Iterable[Middleware], but_build_parse_stackconsumes the iterable when computingappend_stack_typesbefore callinglist(append_middleware)(bibtexparser/entrypoint.py:36-45; same pattern in_build_unparse_stack, lines 66-75). A generator/iterator therefore results in an empty middleware list — silently.Fix: materialize to a list at the top of the builders (or type the params as
List).