Skip to content

Commit

Permalink
mypy fix: Literal and Union in prioritization.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fohrloop committed Apr 21, 2024
1 parent 26f8f78 commit cb2e420
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/wakepy/core/prioritization.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@
from .platform import CURRENT_PLATFORM

if typing.TYPE_CHECKING:
from typing import Callable, List, Literal, Optional, Tuple
import sys
from typing import Callable, List, Optional, Tuple, Union

from .constants import Collection
from .method import MethodCls

OnFail = Literal["error", "warn", "pass"] | Callable[[ActivationResult], None]
if sys.version_info < (3, 8): # pragma: no-cover-if-py-gte-38
from typing_extensions import Literal
else: # pragma: no-cover-if-py-lt-38
from typing import Literal

OnFail = Union[Literal["error", "warn", "pass"], Callable[[ActivationResult], None]]

MethodClsCollection = Collection[MethodCls]

Expand Down

0 comments on commit cb2e420

Please sign in to comment.