use _typeshed's Path aliases (#4214)

This commit is contained in:
Jelle Zijlstra
2020-06-10 20:57:09 -07:00
committed by GitHub
parent 86f03f2d7b
commit 43e93f803f
42 changed files with 483 additions and 757 deletions

View File

@@ -1,8 +1,6 @@
# Stubs for sndhdr (Python 2 and 3)
import os
import sys
from typing import Any, NamedTuple, Optional, Tuple, Union
from _typeshed import AnyPath
from typing import NamedTuple, Optional, Tuple, Union
if sys.version_info >= (3, 5):
class SndHeaders(NamedTuple):
@@ -15,10 +13,5 @@ if sys.version_info >= (3, 5):
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]: ...
def what(filename: AnyPath) -> Optional[_SndHeaders]: ...
def whathdr(filename: AnyPath) -> Optional[_SndHeaders]: ...