Files
typeshed/stdlib/@python2/imghdr.pyi
2022-03-16 16:01:33 +01:00

16 lines
441 B
Python

from typing import Any, BinaryIO, Callable, Protocol, Text, overload
class _ReadableBinary(Protocol):
def tell(self) -> int: ...
def read(self, size: int) -> bytes: ...
def seek(self, offset: int) -> Any: ...
_File = Text | _ReadableBinary
@overload
def what(file: _File, h: None = ...) -> str | None: ...
@overload
def what(file: Any, h: bytes) -> str | None: ...
tests: list[Callable[[bytes, BinaryIO | None], str | None]]