mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Split stdlib into Python 2 and 3 versions (#5442)
All new files in stdlib/@python2 are straight copies of the corresponding files in stdlib.
This commit is contained in:
20
stdlib/@python2/imghdr.pyi
Normal file
20
stdlib/@python2/imghdr.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
import os
|
||||
import sys
|
||||
from typing import Any, BinaryIO, Callable, List, Optional, Protocol, Text, Union, overload
|
||||
|
||||
class _ReadableBinary(Protocol):
|
||||
def tell(self) -> int: ...
|
||||
def read(self, size: int) -> bytes: ...
|
||||
def seek(self, offset: int) -> Any: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
_File = Union[Text, os.PathLike[Text], _ReadableBinary]
|
||||
else:
|
||||
_File = Union[Text, _ReadableBinary]
|
||||
|
||||
@overload
|
||||
def what(file: _File, h: None = ...) -> Optional[str]: ...
|
||||
@overload
|
||||
def what(file: Any, h: bytes) -> Optional[str]: ...
|
||||
|
||||
tests: List[Callable[[bytes, Optional[BinaryIO]], Optional[str]]]
|
||||
Reference in New Issue
Block a user