Use new union syntax in rest of stdlib (#5884)

This commit is contained in:
Akuli
2021-08-08 16:44:30 +03:00
committed by GitHub
parent ebacd320a3
commit df6a211855
7 changed files with 177 additions and 228 deletions

View File

@@ -1,7 +1,7 @@
import typing
from _typeshed import StrPath
from datetime import tzinfo
from typing import Any, Iterable, Optional, Protocol, Sequence, Set, Type
from typing import Any, Iterable, Protocol, Sequence, Set, Type
_T = typing.TypeVar("_T", bound="ZoneInfo")
@@ -16,14 +16,14 @@ class ZoneInfo(tzinfo):
@classmethod
def no_cache(cls: Type[_T], key: str) -> _T: ...
@classmethod
def from_file(cls: Type[_T], __fobj: _IOBytes, key: Optional[str] = ...) -> _T: ...
def from_file(cls: Type[_T], __fobj: _IOBytes, key: str | None = ...) -> _T: ...
@classmethod
def clear_cache(cls, *, only_keys: Iterable[str] = ...) -> None: ...
# 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[StrPath]] = ...) -> None: ...
def reset_tzpath(to: Sequence[StrPath] | None = ...) -> None: ...
def available_timezones() -> Set[str]: ...
TZPATH: Sequence[str]