Skip to content

Commit

Permalink
🐛 fix union type
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Apr 21, 2024
1 parent c413ef4 commit 223cf3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nepattern/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def __calc_eq__(self, other): # pragma: no cover


@final
class StrPattern(BasePattern[str, str | bytes | bytearray, Literal[MatchMode.TYPE_CONVERT]]):
class StrPattern(BasePattern[str, Union[str, bytes, bytearray], Literal[MatchMode.TYPE_CONVERT]]):
def __init__(self):
super().__init__(mode=MatchMode.TYPE_CONVERT, origin=str, accepts=Union[str, bytes, bytearray], alias="str")

Expand All @@ -526,7 +526,7 @@ def __calc_eq__(self, other): # pragma: no cover


@final
class BytesPattern(BasePattern[bytes, str | bytes | bytearray, Literal[MatchMode.TYPE_CONVERT]]):
class BytesPattern(BasePattern[bytes, Union[str, bytes, bytearray], Literal[MatchMode.TYPE_CONVERT]]):
def __init__(self):
super().__init__(mode=MatchMode.TYPE_CONVERT, origin=bytes, accepts=Union[str, bytes, bytearray], alias="bytes")

Expand Down Expand Up @@ -624,7 +624,7 @@ def __calc_eq__(self, other): # pragma: no cover


@final
class BoolPattern(BasePattern[bool, bool | str | bytes, Literal[MatchMode.TYPE_CONVERT]]):
class BoolPattern(BasePattern[bool, Union[str, bytes, bool], Literal[MatchMode.TYPE_CONVERT]]):
def __init__(self):
super().__init__(mode=MatchMode.TYPE_CONVERT, origin=bool, alias="bool")

Expand Down

0 comments on commit 223cf3b

Please sign in to comment.