From 2a8bc03167d4448390ea3bc7e902d7b1a473f9ac Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 19 Oct 2023 01:50:06 -0700 Subject: [PATCH] optimize: typing --- src/ocrmypdf/optimize.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ocrmypdf/optimize.py b/src/ocrmypdf/optimize.py index 388e1505..a1bb2b33 100644 --- a/src/ocrmypdf/optimize.py +++ b/src/ocrmypdf/optimize.py @@ -14,7 +14,7 @@ from collections import defaultdict from collections.abc import Iterator, MutableSet, Sequence from os import fspath from pathlib import Path -from typing import Callable, NamedTuple, NewType +from typing import Any, Callable, NamedTuple, NewType from warnings import warn from zlib import compress @@ -623,7 +623,7 @@ def transcode_pngs( image_name_fn: Callable[[Path, Xref], Path], root: Path, options, - executor, + executor: Executor, ) -> None: """Apply lossy transcoding to PNGs.""" modified: MutableSet[Xref] = set() @@ -668,8 +668,8 @@ DEFAULT_EXECUTOR = SerialExecutor() def optimize( input_file: Path, output_file: Path, - context, - save_settings, + context: PdfContext, + save_settings: dict[str, Any], executor: Executor = DEFAULT_EXECUTOR, ) -> Path: """Optimize images in a PDF file."""