Skip to content

Commit

Permalink
Use Buffer where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Gobot1234 committed Aug 15, 2023
1 parent 1ffa250 commit a634e54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion steam/_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from .types.vdf import BinaryVDFDict, VDFDict

if TYPE_CHECKING:
from typing_extensions import Buffer

from .state import ConnectionState

DOCS_BUILDING: bool = getattr(builtins, "__sphinx__", False)
Expand Down Expand Up @@ -121,7 +123,7 @@ def binary_loads(
STEAM_EPOCH: Final = datetime(2003, 1, 1, tzinfo=timezone.utc)


def READ_U32(s: bytes, unpacker: Callable[[bytes], tuple[int]] = struct.Struct("<I").unpack_from, /) -> int:
def READ_U32(s: Buffer, unpacker: Callable[[Buffer], tuple[int]] = struct.Struct("<I").unpack_from, /) -> int:
(u32,) = unpacker(s)
return u32

Expand Down

0 comments on commit a634e54

Please sign in to comment.