Skip to content

Commit 0bc98a1

Browse files
bluetechJelleZijlstra
authored andcommitted
Add stdlib/2and3/imghdr stubs (#2318)
Ad defined in https://docs.python.org/3/library/imghdr.html.
1 parent cadacab commit 0bc98a1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

stdlib/2and3/imghdr.pyi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from typing import overload, Union, Text, BinaryIO, Optional, Any, List, Callable
2+
import sys
3+
import os
4+
5+
6+
if sys.version_info >= (3, 6):
7+
_File = Union[Text, os.PathLike[Text], BinaryIO]
8+
else:
9+
_File = Union[Text, BinaryIO]
10+
11+
12+
@overload
13+
def what(file: _File) -> Optional[str]: ...
14+
@overload
15+
def what(file: Any, h: bytes)-> Optional[str]: ...
16+
tests: List[Callable[[bytes, BinaryIO], Optional[str]]]

0 commit comments

Comments
 (0)