From 3569096e896f6c9177c30af4b2c5d8be92aa4ffa Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Wed, 15 Dec 2021 18:26:05 -0800 Subject: [PATCH] Widen type hints to placate mypy Apparently there's no way to specify a Sequence with fixed length, so Union it is! --- klamath/elements.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/klamath/elements.py b/klamath/elements.py index 753c8f7..a477642 100644 --- a/klamath/elements.py +++ b/klamath/elements.py @@ -2,7 +2,7 @@ Functionality for reading/writing elements (geometry, text labels, structure references) and associated properties. """ -from typing import Dict, Tuple, Optional, BinaryIO, TypeVar, Type +from typing import Dict, Tuple, Optional, BinaryIO, TypeVar, Type, Union from abc import ABCMeta, abstractmethod from dataclasses import dataclass @@ -144,7 +144,7 @@ class Reference(Element): basis vectors to match it. """ - colrow: Optional[Tuple[int, int]] + colrow: Optional[Union[Tuple[int, int], numpy.ndarray]] """ Number of columns and rows (AREF) or None (SREF) """ properties: Dict[int, bytes]