Skip to content

Commit 4e5a72d

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents d27df55 + 5731418 commit 4e5a72d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

magic_filter/magic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import operator
22
import re
33
from functools import wraps
4-
from typing import Any, Callable, Optional, Pattern, Sequence, Tuple, Type, TypeVar, Union
4+
from typing import Any, Callable, Optional, Pattern, Sequence, Set, Tuple, Type, TypeVar, Union
55

66
from magic_filter.exceptions import RejectOperations, SwitchModeToAll, SwitchModeToAny
77
from magic_filter.operations import (
@@ -213,7 +213,7 @@ def is_(self: MagicT, value: Any) -> MagicT:
213213
def is_not(self: MagicT, value: Any) -> MagicT:
214214
return self._extend(CombinationOperation(right=value, combinator=operator.is_not))
215215

216-
def in_(self: MagicT, iterable: Sequence[Any]) -> MagicT:
216+
def in_(self: MagicT, iterable: Union[Sequence[Any], Set[Any]]) -> MagicT:
217217
return self._extend(FunctionOperation(in_op, iterable))
218218

219219
def contains(self: MagicT, value: Any) -> MagicT:

magic_filter/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
from typing import Any
1+
from typing import Any, Sequence, Set, Union
22

33

4-
def in_op(a: Any, b: Any) -> bool:
4+
def in_op(a: Union[Sequence[Any], Set[Any]], b: Any) -> bool:
55
try:
66
return b in a
77
except TypeError:
88
return False
99

1010

11-
def contains_op(a: Any, b: Any) -> bool:
11+
def contains_op(a: Any, b: Union[Sequence[Any], Set[Any]]) -> bool:
1212
try:
1313
return a in b
1414
except TypeError:

0 commit comments

Comments
 (0)