Skip to content

Commit

Permalink
feat(utils): add SupportsLessThan protocol to types util.
Browse files Browse the repository at this point in the history
Signed-off-by: Braden Mars <bradenmars@bradenmars.me>
  • Loading branch information
BradenM committed Dec 11, 2022
1 parent f1742da commit 489a9b0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions micropy/utils/types.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
"""Type utilities and variables."""

from os import PathLike
from typing import Union
from typing import Any, Union

from typing_extensions import TypeAlias
from typing_extensions import Protocol, TypeAlias, runtime_checkable

# PathLike string or string type alias.
PathStr: TypeAlias = Union[str, PathLike[str]]


@runtime_checkable
class SupportsLessThan(Protocol):
def __lt__(self, other: Any) -> bool:
...

0 comments on commit 489a9b0

Please sign in to comment.