mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-13 10:08:27 +08:00
0bc98a18f0
Ad defined in https://docs.python.org/3/library/imghdr.html.
17 lines
402 B
Python
17 lines
402 B
Python
from typing import overload, Union, Text, BinaryIO, Optional, Any, List, Callable
|
|
import sys
|
|
import os
|
|
|
|
|
|
if sys.version_info >= (3, 6):
|
|
_File = Union[Text, os.PathLike[Text], BinaryIO]
|
|
else:
|
|
_File = Union[Text, BinaryIO]
|
|
|
|
|
|
@overload
|
|
def what(file: _File) -> Optional[str]: ...
|
|
@overload
|
|
def what(file: Any, h: bytes)-> Optional[str]: ...
|
|
tests: List[Callable[[bytes, BinaryIO], Optional[str]]]
|