1414
1515class Utils :
1616 @staticmethod
17- def parse_range_header (range_header : str , content_length : Optional [int ] = None ) -> tuple [ int , int ] :
17+ def parse_range_header (range_header : str , content_length : Optional [int ] = None ) -> tuple :
1818 """
1919 Parses a Range header string and returns the start and end byte positions.
2020 Example input: "bytes=0-499"
@@ -54,7 +54,7 @@ def read(self, size: int = -1) -> bytes:
5454 def readline (self , size : int = - 1 ) -> bytes :
5555 return self ._stream .readline (size )
5656
57- def readlines (self , size : int = - 1 ) -> list [ bytes ] :
57+ def readlines (self , size : int = - 1 ) -> list :
5858 return self ._stream .readlines (size )
5959
6060 def readable (self ) -> bool :
@@ -73,7 +73,7 @@ def tell(self) -> int:
7373class ConcatenatedInputStreamTestCase (ABC ):
7474
7575 @abstractmethod
76- def generate (self ) -> tuple [ bytes , BinaryIO ] :
76+ def generate (self ) -> tuple :
7777 pass
7878
7979
@@ -83,7 +83,7 @@ def __init__(self, head: bytes, tail: bytes, is_seekable: bool = True):
8383 self ._tail = tail
8484 self ._is_seekable = is_seekable
8585
86- def generate (self ) -> tuple [ bytes , BinaryIO ] :
86+ def generate (self ) -> tuple :
8787 """
8888 Generate a pair of:
8989 (a) implementation under test
@@ -135,7 +135,7 @@ def to_string(test_case) -> str:
135135]
136136
137137
138- def verify (test_case : ConcatenatedInputStreamTestCase , apply : Callable [[BinaryIO ], tuple [ any , bool ] ]):
138+ def verify (test_case : ConcatenatedInputStreamTestCase , apply : Callable [[BinaryIO ], tuple ]):
139139 """
140140 This method applies given function iteratively to both implementation under test
141141 and reference implementation of the stream, and verifies the result on each step is identical.
@@ -216,7 +216,7 @@ def apply(buffer: BinaryIO):
216216 verify (test_case , apply )
217217
218218
219- def seeks_to_string (seeks : [ tuple [ int , int ]] ):
219+ def seeks_to_string (seeks : list ):
220220 ", " .join (list (map (lambda seek : f"Seek: offset={ seek [0 ]} , whence={ seek [1 ]} " , seeks )))
221221
222222
@@ -238,7 +238,7 @@ def seeks_to_string(seeks: [tuple[int, int]]):
238238 ],
239239 ids = seeks_to_string ,
240240)
241- def test_seek (config , test_case : ConcatenatedInputStreamTestCase , seeks : list [ tuple [ int , int ]] ):
241+ def test_seek (config , test_case : ConcatenatedInputStreamTestCase , seeks : list ):
242242 def read_and_restore (buf : BinaryIO ) -> bytes :
243243 pos = buf .tell ()
244244 result = buf .read ()
0 commit comments