Coverage for melissa/types/__init__.py: 71%

14 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-09-22 10:36 +0000

1from typing import Protocol, Any, Union, List, TypeVar 

2 

3 

4class GetProtocol(Protocol): 

5 _is_reception_over: bool 

6 

7 def _get_with_eviction(self, index: Union[List[int], int]) -> Any: 

8 ... 

9 

10 def _get_without_eviction(self, index: Union[List[int], int]) -> Any: 

11 ... 

12 

13 

14class ThresholdProtocol(Protocol): 

15 threshold: int 

16 

17 def _size(self) -> int: 

18 ... 

19 

20 def _is_sampling_ready(self) -> bool: 

21 ... 

22 

23 

24Threshold = TypeVar("Threshold", bound=ThresholdProtocol)