Skip to content

Commit bb3108b

Browse files
authored
Minor typing fixes (#87)
1 parent d78f585 commit bb3108b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pylibjpeg/utils.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __call__(self, src: bytes, **kwargs: Any) -> np.ndarray:
3232

3333

3434
class Encoder(Protocol):
35-
def __call__(self, src: np.ndarray, **kwargs: Any) -> Union[bytes, bytearray]:
35+
def __call__(self, src: Union[np.ndarray, bytes], **kwargs: Any) -> Union[bytes, bytearray]:
3636
... # pragma: no cover
3737

3838

@@ -347,7 +347,10 @@ def get_pixel_data_decoders(
347347

348348
entry_point = "pylibjpeg.pixel_data_decoders"
349349
decoders = cast(
350-
Union[Dict[str, Decoder], Dict[str, Dict[str, Decoder]]],
350+
Union[
351+
Dict[str, Union[Decoder, Encoder]],
352+
Dict[str, Dict[str, Union[Decoder, Encoder]]],
353+
],
351354
_get_pixel_data_plugins(entry_point, version),
352355
)
353356
return decoders

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ license = {text = "MIT"}
3232
name = "pylibjpeg"
3333
readme = "README.md"
3434
requires-python = ">=3.8"
35-
version = "2.0.0"
35+
version = "2.0.1"
3636

3737

3838
[project.optional-dependencies]

0 commit comments

Comments
 (0)