From 09c3ba31af7d43a99f64f710546cd6e4b5e73a18 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 5 Nov 2022 07:58:59 -0700 Subject: [PATCH] winsound: accepts buffers https://github.com/python/cpython/blob/b5f711185bd11819566068ddf2a74a1402340e2d/PC/winsound.c#L93 --- stdlib/winsound.pyi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/winsound.pyi b/stdlib/winsound.pyi index 588bd5969e98..fd5a552cf9c1 100644 --- a/stdlib/winsound.pyi +++ b/stdlib/winsound.pyi @@ -1,4 +1,5 @@ import sys +from _typeshed import ReadableBuffer from typing import overload from typing_extensions import Literal @@ -21,7 +22,7 @@ if sys.platform == "win32": def Beep(frequency: int, duration: int) -> None: ... # Can actually accept anything ORed with 4, and if not it's definitely str, but that's inexpressible @overload - def PlaySound(sound: bytes | None, flags: Literal[4]) -> None: ... + def PlaySound(sound: ReadableBuffer | None, flags: Literal[4]) -> None: ... @overload - def PlaySound(sound: str | bytes | None, flags: int) -> None: ... + def PlaySound(sound: str | ReadableBuffer | None, flags: int) -> None: ... def MessageBeep(type: int = ...) -> None: ...