mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
use _typeshed's Path aliases (#4214)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user