diff --git a/comicfn2dict/parse.py b/comicfn2dict/parse.py index c833a8d..7554232 100644 --- a/comicfn2dict/parse.py +++ b/comicfn2dict/parse.py @@ -1,12 +1,13 @@ """Parse comic book archive names using the simple 'parse' parser.""" + from __future__ import annotations from calendar import month_abbr from copy import copy from pathlib import Path from pprint import pformat -from re import Match, Pattern from sys import maxsize +from typing import TYPE_CHECKING from comicfn2dict.log import print_log_header from comicfn2dict.regex import ( @@ -35,6 +36,9 @@ from comicfn2dict.regex import ( YEAR_TOKEN_RE, ) +if TYPE_CHECKING: + from re import Match, Pattern + _DATE_KEYS = frozenset({"year", "month", "day"}) _REMAINING_GROUP_KEYS = ("series", "title") # Ordered by commonness. diff --git a/comicfn2dict/unparse.py b/comicfn2dict/unparse.py index c4df994..707bf77 100644 --- a/comicfn2dict/unparse.py +++ b/comicfn2dict/unparse.py @@ -1,4 +1,5 @@ """Unparse comic filenames.""" + from __future__ import annotations from calendar import month_abbr