Skip to content

Commit 5936a93

Browse files
committed
using Literal for ChainFilter
1 parent 2897795 commit 5936a93

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

O365/utils/query.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import datetime as dt
44
from abc import ABC, abstractmethod
5-
from typing import Union, Optional, TYPE_CHECKING, Type, Iterator
6-
5+
from typing import Union, Optional, TYPE_CHECKING, Type, Iterator, Literal
76

87
if TYPE_CHECKING:
98
from O365.connection import Protocol
@@ -124,7 +123,7 @@ def render(self, item_name: Optional[str] = None) -> str:
124123
class ChainFilter(OperationQueryFilter):
125124
__slots__ = ("_operation", "_filter_instances")
126125

127-
def __init__(self, operation: str, filter_instances: list[QueryFilter]):
126+
def __init__(self, operation: Literal["and", "or"], filter_instances: list[QueryFilter]):
128127
assert operation in ("and", "or")
129128
super().__init__(operation)
130129
self._filter_instances: list[QueryFilter] = filter_instances

0 commit comments

Comments
 (0)