Skip to content

Commit

Permalink
Use Union and Optional for 3.7 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
tekktrik committed Apr 3, 2023
1 parent d642abe commit b41effc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/digitalio/digitalio_DigitalInOut_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
Helper functions for testing parallel64.digitalio.DigitalInOut settings
"""

from typing import Iterable
from typing import Iterable, Union, Optional
from typing_extensions import TypedDict, TypeAlias, Literal

from parallel64.digitalio import DigitalInOut, Direction, Pull, DriveMode

SettingOption: TypeAlias = Literal["direction", "pull", "drive_mode", "value"]
Setting: TypeAlias = Direction | DriveMode | Pull | bool
SettingResult: TypeAlias = BaseException | None
Setting: TypeAlias = Union[Direction, DriveMode, Pull, bool]
SettingResult: TypeAlias = Optional[BaseException]
SettingRule: TypeAlias = tuple[Setting, SettingResult]
GetSetOption: Literal["get", "set"]

Expand All @@ -31,7 +31,7 @@ class SettingRuleSet(TypedDict):
value: GetSetRules


PossibleSettingRuleSet: TypeAlias = SettingRuleSet | BaseException
PossibleSettingRuleSet: TypeAlias = Union[SettingRuleSet, BaseException]


class PinRuleSet(TypedDict):
Expand Down

0 comments on commit b41effc

Please sign in to comment.