mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
* run script and do some manual changes (Akuli) * do the whole thing manually (srittau) * merge changes (Akuli) Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
17 lines
511 B
Python
17 lines
511 B
Python
import os
|
|
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: ...
|
|
|
|
_File = Union[Text, os.PathLike[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]]]
|