Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Aug 8, 2024
1 parent 9d15f25 commit af50521
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cantok/tokens/abstract/abstract_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from abc import ABC, abstractmethod
from threading import RLock
from typing import Tuple, List, Dict, Awaitable, Optional, Union, Any

from collections.abc import Iterable

from cantok.errors import CancellationError
from cantok.tokens.abstract.cancel_cause import CancelCause
Expand Down Expand Up @@ -79,9 +79,9 @@ def __add__(self, item: 'AbstractToken') -> 'AbstractToken':
def __bool__(self) -> bool:
return self.keep_on()

def filter_tokens(self, tokens: Tuple['AbstractToken', ...]) -> List['AbstractToken']:
def filter_tokens(self, tokens: Iterable['AbstractToken']) -> List['AbstractToken']:
from cantok import DefaultToken

result: List[AbstractToken] = []

for token in tokens:
Expand Down
4 changes: 2 additions & 2 deletions cantok/tokens/timeout_token.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from time import monotonic_ns, perf_counter

from typing import Union, Callable, Tuple, List, Dict, Any
from collections.abc import Iterable

from cantok import AbstractToken
from cantok import ConditionToken
Expand Down Expand Up @@ -33,7 +33,7 @@ def function() -> bool:

super().__init__(function, *tokens, cancelled=cancelled)

def filter_tokens(self, tokens: Tuple['AbstractToken', ...]) -> List['AbstractToken']:
def filter_tokens(self, tokens: Iterable[AbstractToken]) -> List[AbstractToken]:
result: List[AbstractToken] = []

for token in tokens:
Expand Down

0 comments on commit af50521

Please sign in to comment.