massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / zoneinfo / __init__.pyi
1 import typing
2 from _typeshed import StrPath
3 from datetime import tzinfo
4 from typing import Any, Iterable, Protocol, Sequence, Type
5
6 _T = typing.TypeVar("_T", bound="ZoneInfo")
7
8 class _IOBytes(Protocol):
9     def read(self, __size: int) -> bytes: ...
10     def seek(self, __size: int, __whence: int = ...) -> Any: ...
11
12 class ZoneInfo(tzinfo):
13     @property
14     def key(self) -> str: ...
15     def __init__(self, key: str) -> None: ...
16     @classmethod
17     def no_cache(cls: Type[_T], key: str) -> _T: ...
18     @classmethod
19     def from_file(cls: Type[_T], __fobj: _IOBytes, key: str | None = ...) -> _T: ...
20     @classmethod
21     def clear_cache(cls, *, only_keys: Iterable[str] = ...) -> None: ...
22
23 # Note: Both here and in clear_cache, the types allow the use of `str` where
24 # a sequence of strings is required. This should be remedied if a solution
25 # to this typing bug is found: https://github.com/python/typing/issues/256
26 def reset_tzpath(to: Sequence[StrPath] | None = ...) -> None: ...
27 def available_timezones() -> set[str]: ...
28
29 TZPATH: Sequence[str]
30
31 class ZoneInfoNotFoundError(KeyError): ...
32 class InvalidTZPathWarning(RuntimeWarning): ...