Replace PathLike unions with aliases from _typeshed (#5467)

Standardize on 'from os import PathLike'
This commit is contained in:
Sebastian Rittau
2021-05-16 21:38:00 +02:00
committed by GitHub
parent d72b1e8149
commit e5abd08f93
9 changed files with 30 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
import os
import typing
from _typeshed import StrPath
from datetime import tzinfo
from typing import Any, AnyStr, Iterable, Optional, Protocol, Sequence, Set, Type, Union
from typing import Any, Iterable, Optional, Protocol, Sequence, Set, Type
_T = typing.TypeVar("_T", bound="ZoneInfo")
@@ -23,7 +23,7 @@ class ZoneInfo(tzinfo):
# Note: Both here and in clear_cache, the types allow the use of `str` where
# a sequence of strings is required. This should be remedied if a solution
# to this typing bug is found: https://github.com/python/typing/issues/256
def reset_tzpath(to: Optional[Sequence[Union[os.PathLike[AnyStr], str]]] = ...) -> None: ...
def reset_tzpath(to: Optional[Sequence[StrPath]] = ...) -> None: ...
def available_timezones() -> Set[str]: ...
TZPATH: Sequence[str]