Use typing_extensions.Self in the stdlib (#9694)

This commit is contained in:
Alex Waygood
2023-02-09 09:12:13 +00:00
committed by GitHub
parent 10086c06a1
commit 9ed39d8796
98 changed files with 627 additions and 654 deletions

View File

@@ -1,7 +1,8 @@
from _typeshed import Self, StrPath
from _typeshed import StrPath
from collections.abc import Iterable, Sequence
from datetime import datetime, timedelta, tzinfo
from typing import Any, Protocol
from typing_extensions import Self
__all__ = ["ZoneInfo", "reset_tzpath", "available_timezones", "TZPATH", "ZoneInfoNotFoundError", "InvalidTZPathWarning"]
@@ -14,9 +15,9 @@ class ZoneInfo(tzinfo):
def key(self) -> str: ...
def __init__(self, key: str) -> None: ...
@classmethod
def no_cache(cls: type[Self], key: str) -> Self: ...
def no_cache(cls, key: str) -> Self: ...
@classmethod
def from_file(cls: type[Self], __fobj: _IOBytes, key: str | None = ...) -> Self: ...
def from_file(cls, __fobj: _IOBytes, key: str | None = ...) -> Self: ...
@classmethod
def clear_cache(cls, *, only_keys: Iterable[str] | None = ...) -> None: ...
def tzname(self, __dt: datetime | None) -> str | None: ...