use _typeshed's Path aliases (#4214)

This commit is contained in:
Jelle Zijlstra
2020-06-10 20:57:09 -07:00
committed by GitHub
parent 86f03f2d7b
commit 43e93f803f
42 changed files with 483 additions and 757 deletions

View File

@@ -1,15 +1,8 @@
# Based on http://docs.python.org/3.5/library/configparser.html and on
# reading configparser.py.
from _typeshed import AnyPath, StrPath
import sys
from typing import (AbstractSet, MutableMapping, Mapping, Dict, Sequence, List,
Union, Iterable, Iterator, Callable, Any, IO, overload,
Optional, Pattern, Type, TypeVar, ClassVar)
# Types only used in type comments only
from typing import Optional, Tuple # noqa
if sys.version_info >= (3, 6):
from os import PathLike
Optional, Pattern, Type, TypeVar, ClassVar, Tuple)
# Internal type aliases
_section = Mapping[str, str]
@@ -19,11 +12,9 @@ _converters = Dict[str, _converter]
_T = TypeVar('_T')
if sys.version_info >= (3, 7):
_Path = Union[str, bytes, PathLike[str]]
elif sys.version_info >= (3, 6):
_Path = Union[str, PathLike[str]]
_Path = AnyPath
else:
_Path = str
_Path = StrPath
DEFAULTSECT: str
MAX_INTERPOLATION_DEPTH: int