mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-18 09:05:07 +08:00
Add stdlib/2and3/imghdr stubs (#2318)
Ad defined in https://docs.python.org/3/library/imghdr.html.
This commit is contained in:
committed by
Jelle Zijlstra
parent
cadacab088
commit
0bc98a18f0
16
stdlib/2and3/imghdr.pyi
Normal file
16
stdlib/2and3/imghdr.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
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]]]
|
||||
Reference in New Issue
Block a user