mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 20:01:29 +08:00
Add support for PathLike to mimetypes.guess_types() (#3874)
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
# Stubs for mimetypes
|
||||
|
||||
from typing import Dict, IO, List, Optional, Sequence, Text, Tuple
|
||||
from typing import Dict, IO, List, Optional, Sequence, Text, Tuple, AnyStr, Union
|
||||
import sys
|
||||
|
||||
def guess_type(url: Text,
|
||||
strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
from os import PathLike
|
||||
def guess_type(url: Union[Text, PathLike[str]],
|
||||
strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
|
||||
else:
|
||||
def guess_type(url: Text,
|
||||
strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
|
||||
|
||||
def guess_all_extensions(type: str, strict: bool = ...) -> List[str]: ...
|
||||
def guess_extension(type: str, strict: bool = ...) -> Optional[str]: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user