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: 3 additions & 2 deletions bibtexparser/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import List
from typing import Optional
from typing import TextIO
from typing import Tuple
from typing import Union

from .library import Library
Expand Down Expand Up @@ -80,7 +81,7 @@ def _handle_deprecated_write_params(
prepend_middleware: Optional[Iterable[Middleware]],
kwargs: dict,
function_name: str,
) -> tuple[Optional[Iterable[Middleware]], Optional[Iterable[Middleware]]]:
) -> Tuple[Optional[Iterable[Middleware]], Optional[Iterable[Middleware]]]:
"""Handle deprecated parameter names for write functions.

:param unparse_stack: Current unparse_stack value
Expand Down Expand Up @@ -126,7 +127,7 @@ def parse_string(
parse_stack: Optional[Iterable[Middleware]] = None,
append_middleware: Optional[Iterable[Middleware]] = None,
library: Optional[Library] = None,
):
) -> Library:
"""Parse a BibTeX string.

:param bibtex_str: BibTeX string to parse
Expand Down
8 changes: 4 additions & 4 deletions bibtexparser/middlewares/latex_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class LatexEncodingMiddleware(_PyStringTransformerMiddleware):

def __init__(
self,
keep_math: bool = None,
enclose_urls: bool = None,
keep_math: Optional[bool] = None,
enclose_urls: Optional[bool] = None,
encoder: Optional[UnicodeToLatexEncoder] = None,
allow_inplace_modification: bool = True,
):
Expand Down Expand Up @@ -163,8 +163,8 @@ class LatexDecodingMiddleware(_PyStringTransformerMiddleware):
def __init__(
self,
allow_inplace_modification: bool = True,
keep_braced_groups: bool = None,
keep_math_mode: bool = None,
keep_braced_groups: Optional[bool] = None,
keep_math_mode: Optional[bool] = None,
decoder: Optional[LatexNodes2Text] = None,
):
super().__init__(
Expand Down
6 changes: 3 additions & 3 deletions bibtexparser/middlewares/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _NameTransformerMiddleware(BlockMiddleware, abc.ABC):
def __init__(
self,
allow_inplace_modification: bool = True,
name_fields: Tuple[str] = ("author", "editor", "translator"),
name_fields: Tuple[str, ...] = ("author", "editor", "translator"),
):
super().__init__(
allow_inplace_modification=allow_inplace_modification,
Expand All @@ -46,7 +46,7 @@ def __init__(
self._name_fields = name_fields

@property
def name_fields(self) -> Tuple[str]:
def name_fields(self) -> Tuple[str, ...]:
"""The fields that contain names, considered by this middleware."""
return self._name_fields

Expand Down Expand Up @@ -187,7 +187,7 @@ def __init__(
self,
style: Literal["last", "first"] = "last",
allow_inplace_modification: bool = True,
name_fields: Tuple[str] = ("author", "editor", "translator"),
name_fields: Tuple[str, ...] = ("author", "editor", "translator"),
):
self.style = style
super().__init__(allow_inplace_modification, name_fields)
Expand Down
Loading