mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-16 23:13:37 +08:00
Use PEP 570 syntax in stdlib (#11250)
This commit is contained in:
@@ -7,8 +7,8 @@ from typing_extensions import Self
|
||||
__all__ = ["ZoneInfo", "reset_tzpath", "available_timezones", "TZPATH", "ZoneInfoNotFoundError", "InvalidTZPathWarning"]
|
||||
|
||||
class _IOBytes(Protocol):
|
||||
def read(self, __size: int) -> bytes: ...
|
||||
def seek(self, __size: int, __whence: int = ...) -> Any: ...
|
||||
def read(self, size: int, /) -> bytes: ...
|
||||
def seek(self, size: int, whence: int = ..., /) -> Any: ...
|
||||
|
||||
class ZoneInfo(tzinfo):
|
||||
@property
|
||||
@@ -17,12 +17,12 @@ class ZoneInfo(tzinfo):
|
||||
@classmethod
|
||||
def no_cache(cls, key: str) -> Self: ...
|
||||
@classmethod
|
||||
def from_file(cls, __fobj: _IOBytes, key: str | None = None) -> Self: ...
|
||||
def from_file(cls, fobj: _IOBytes, /, key: str | None = None) -> Self: ...
|
||||
@classmethod
|
||||
def clear_cache(cls, *, only_keys: Iterable[str] | None = None) -> None: ...
|
||||
def tzname(self, __dt: datetime | None) -> str | None: ...
|
||||
def utcoffset(self, __dt: datetime | None) -> timedelta | None: ...
|
||||
def dst(self, __dt: datetime | None) -> timedelta | None: ...
|
||||
def tzname(self, dt: datetime | None, /) -> str | None: ...
|
||||
def utcoffset(self, dt: datetime | None, /) -> timedelta | None: ...
|
||||
def dst(self, dt: datetime | None, /) -> timedelta | 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
|
||||
|
||||
Reference in New Issue
Block a user