Skip to content

Commit 0391e72

Browse files
rowilliaambv
authored andcommitted
Expose pytz.UTC as an instance as opposed to as a class (#723)
* Expose pytz.UTC as an instance as opposed to as a class pytz shadows UTC after declaring it with a singleton: https://github.com/newvem/pytz/blob/master/pytz/__init__.py#L135 This fixes #710
1 parent 1dff8e4 commit 0391e72

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

third_party/2and3/pytz/__init__.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ country_timezones = ... # type: Dict
1111
country_names = ... # type: Dict
1212

1313

14-
class UTC(dt.tzinfo):
14+
class _UTCclass(dt.tzinfo):
1515
zone = ... # type: str
1616
def fromutc(self, dt: dt.datetime) -> dt.datetime: ...
1717
def utcoffset(self, dt: Optional[dt.datetime]) -> dt.timedelta: ... # type: ignore
@@ -20,6 +20,7 @@ class UTC(dt.tzinfo):
2020
def localize(self, dt: dt.datetime, is_dst: bool=...) -> dt.datetime: ...
2121
def normalize(self, dt: dt.datetime, is_dst: bool=...) -> dt.datetime: ...
2222

23-
utc = ... # type: UTC
23+
utc = ... # type: _UTCclass
24+
UTC = ... # type: _UTCclass
2425

25-
def timezone(zone: str) -> UTC: ...
26+
def timezone(zone: str) -> dt.tzinfo: ...

0 commit comments

Comments
 (0)