From df2970865b02d5bc71546a012e85d28688b279eb Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 23 Mar 2017 08:23:06 -0700 Subject: [PATCH] stubs for sndhdr (#1070) --- stdlib/2and3/sndhdr.pyi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 stdlib/2and3/sndhdr.pyi diff --git a/stdlib/2and3/sndhdr.pyi b/stdlib/2and3/sndhdr.pyi new file mode 100644 index 000000000..aecd70b46 --- /dev/null +++ b/stdlib/2and3/sndhdr.pyi @@ -0,0 +1,25 @@ +# Stubs for sndhdr (Python 2 and 3) + +import os +import sys +from typing import Any, NamedTuple, Optional, Tuple, Union + +if sys.version_info >= (3, 5): + SndHeaders = NamedTuple('SndHeaders', [ + ('filetype', str), + ('framerate', int), + ('nchannels', int), + ('nframes', int), + ('sampwidth', Union[int, str]), + ]) + _SndHeaders = SndHeaders +else: + _SndHeaders = Tuple[str, int, int, int, Union[int, str]] + +if sys.version_info >= (3, 6): + _Path = Union[str, bytes, os.PathLike[Any]] +else: + _Path = Union[str, bytes] + +def what(filename: _Path) -> Optional[_SndHeaders]: ... +def whathdr(filename: _Path) -> Optional[_SndHeaders]: ...