mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Optional, Union, overload
|
||||
from typing import overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.platform == "win32":
|
||||
@@ -21,7 +21,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: Optional[bytes], flags: Literal[4]) -> None: ...
|
||||
def PlaySound(sound: bytes | None, flags: Literal[4]) -> None: ...
|
||||
@overload
|
||||
def PlaySound(sound: Optional[Union[str, bytes]], flags: int) -> None: ...
|
||||
def PlaySound(sound: str | bytes | None, flags: int) -> None: ...
|
||||
def MessageBeep(type: int = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user