1- from typing import BinaryIO
1+ from typing import Any , BinaryIO
22from struct import calcsize , pack , unpack
33
44
@@ -13,7 +13,7 @@ def _read_bytes_until(stream: BinaryIO, delimiter: bytes) -> bytes:
1313 return b'' .join (until (lambda x : x == delimiter , stream .read , 1 ))
1414
1515
16- def _read_basic (stream : BinaryIO , endianness : str , basic_type : str ) -> any :
16+ def _read_basic (stream : BinaryIO , endianness : str , basic_type : str ) -> Any :
1717 """Read a value of basic type from a stream.
1818
1919 :arg stream: Stream object.
@@ -31,7 +31,7 @@ def _read_basic(stream: BinaryIO, endianness: str, basic_type: str) -> any:
3131
3232
3333def _write_basic (
34- stream : BinaryIO , endianness : str , basic_type : str , value : any
34+ stream : BinaryIO , endianness : str , basic_type : str , value : Any
3535 ) -> None :
3636 """Write a value of basic type to a stream.
3737
@@ -66,8 +66,8 @@ def cast(c_type: str) -> object:
6666
6767
6868def read (
69- stream : BinaryIO , endianness : str , size_t : str , obj_type : any
70- ) -> any :
69+ stream : BinaryIO , endianness : str , size_t : str , obj_type : Any
70+ ) -> Any :
7171 """Read an object from a stream.
7272
7373 :arg stream: Stream object.
@@ -93,8 +93,8 @@ def read_byte_string(stream: BinaryIO) -> bytes:
9393
9494
9595def write (
96- stream : BinaryIO , endianness : str , size_t : str , obj_type : any ,
97- obj : any ) -> None :
96+ stream : BinaryIO , endianness : str , size_t : str , obj_type : Any ,
97+ obj : Any ) -> None :
9898 """Write an object to a stream.
9999
100100 :arg stream: Stream object.
0 commit comments