Widen type hints to placate mypy

Apparently there's no way to specify a Sequence with fixed length, so
Union it is!
This commit is contained in:
Jan Petykiewicz 2021-12-15 18:26:05 -08:00
parent 6a585294e6
commit 3569096e89

View File

@ -2,7 +2,7 @@
Functionality for reading/writing elements (geometry, text labels, Functionality for reading/writing elements (geometry, text labels,
structure references) and associated properties. 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 abc import ABCMeta, abstractmethod
from dataclasses import dataclass from dataclasses import dataclass
@ -144,7 +144,7 @@ class Reference(Element):
basis vectors to match it. 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) """ """ Number of columns and rows (AREF) or None (SREF) """
properties: Dict[int, bytes] properties: Dict[int, bytes]