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] https://github.com/stub42/pytz/blob/2ed682a7c4079042f50975970fc4f503c8450058/src/pytz/tzinfo.py#L112
This commit is contained in:
aimileus authored and GitHub committed 2022-02-13 07:21:30 -08:00
1 parent 5014f9f50c
commit 5081f684c0
1 file changed
+2 -2
+2 -2
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: ...