|
1 | 1 | from __future__ import annotations
|
2 | 2 |
|
| 3 | +import datetime |
3 | 4 | import sys
|
| 5 | +from collections.abc import Container |
4 | 6 | from typing import List, Tuple, Union
|
5 | 7 |
|
6 | 8 | # Check Python version for TypeAlias support
|
|
15 | 17 | SegmentTuple: TypeAlias = Tuple[str, SegmentValue]
|
16 | 18 | SegmentItem: TypeAlias = Union[str, SegmentTuple]
|
17 | 19 | SegmentSpec: TypeAlias = Union[str, SegmentTuple, List[SegmentItem]]
|
| 20 | + |
| 21 | + _CompliantValue: TypeAlias = Union[str, int, float, datetime.datetime, datetime.date] |
| 22 | + """A compliant value that pointblank can use in a validation step""" |
| 23 | + _CompliantValues: TypeAlias = Container[_CompliantValue] |
| 24 | + """A collection of compliant values that pointblank can use in a validation step""" |
| 25 | + |
18 | 26 | else:
|
19 | 27 | # Python 3.8 and 3.9 compatible type aliases
|
20 | 28 | AbsoluteBounds = Tuple[int, int]
|
|
24 | 32 | SegmentTuple = Tuple[str, SegmentValue]
|
25 | 33 | SegmentItem = Union[str, SegmentTuple]
|
26 | 34 | SegmentSpec = Union[str, SegmentTuple, List[SegmentItem]]
|
| 35 | + _CompliantValue = Union[str, int, float, datetime.datetime, datetime.date] |
| 36 | + """A compliant value that pointblank can use in a validation step""" |
| 37 | + _CompliantValues = Container[_CompliantValue] |
| 38 | + """A collection of compliant values that pointblank can use in a validation step""" |
27 | 39 |
|
28 | 40 | # Add docstrings for better IDE support
|
29 | 41 | AbsoluteBounds.__doc__ = "Absolute bounds (i.e., plus or minus)"
|
|
0 commit comments