Fix argument types of pytz.tzinfo.StaticTzInfo (#7184)

The argument is_dst of the functions StaticTzInfo.localize and
StaticTzInfo.normalize are ignored, and only present for compatibility with
DstTzInfo. The functions in DstTzInfo also accepts None, so for compatibility,
StaticTzInfo should accept them as well.

[^1] 2ed682a7c4/src/pytz/tzinfo.py (L112)
This commit is contained in:
aimileus
2022-02-13 16:21:30 +01:00
committed by GitHub
parent 5014f9f50c
commit 5081f684c0

View File

@@ -19,8 +19,8 @@ class BaseTzInfo(datetime.tzinfo):
class StaticTzInfo(BaseTzInfo):
def fromutc(self, dt: datetime.datetime) -> datetime.datetime: ...
def localize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ...
def normalize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ...
def localize(self, dt: datetime.datetime, is_dst: bool | None = ...) -> datetime.datetime: ...
def normalize(self, dt: datetime.datetime, is_dst: bool | None = ...) -> datetime.datetime: ...
def tzname(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> str: ...
def utcoffset(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> datetime.timedelta: ...
def dst(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> datetime.timedelta: ...