1
- from typing import BinaryIO
1
+ from typing import Any , BinaryIO
2
2
from struct import calcsize , pack , unpack
3
3
4
4
@@ -13,7 +13,7 @@ def _read_bytes_until(stream: BinaryIO, delimiter: bytes) -> bytes:
13
13
return b'' .join (until (lambda x : x == delimiter , stream .read , 1 ))
14
14
15
15
16
- def _read_basic (stream : BinaryIO , endianness : str , basic_type : str ) -> any :
16
+ def _read_basic (stream : BinaryIO , endianness : str , basic_type : str ) -> Any :
17
17
"""Read a value of basic type from a stream.
18
18
19
19
:arg stream: Stream object.
@@ -31,7 +31,7 @@ def _read_basic(stream: BinaryIO, endianness: str, basic_type: str) -> any:
31
31
32
32
33
33
def _write_basic (
34
- stream : BinaryIO , endianness : str , basic_type : str , value : any
34
+ stream : BinaryIO , endianness : str , basic_type : str , value : Any
35
35
) -> None :
36
36
"""Write a value of basic type to a stream.
37
37
@@ -66,8 +66,8 @@ def cast(c_type: str) -> object:
66
66
67
67
68
68
def 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 :
71
71
"""Read an object from a stream.
72
72
73
73
:arg stream: Stream object.
@@ -93,8 +93,8 @@ def read_byte_string(stream: BinaryIO) -> bytes:
93
93
94
94
95
95
def 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 :
98
98
"""Write an object to a stream.
99
99
100
100
:arg stream: Stream object.
0 commit comments