mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-21 03:11:16 +08:00
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 https://github.com/python/typeshed/issues/710
This commit is contained in:
committed by
Łukasz Langa
parent
1dff8e4a45
commit
0391e72a6e
7
third_party/2and3/pytz/__init__.pyi
vendored
7
third_party/2and3/pytz/__init__.pyi
vendored
@@ -11,7 +11,7 @@ country_timezones = ... # type: Dict
|
||||
country_names = ... # type: Dict
|
||||
|
||||
|
||||
class UTC(dt.tzinfo):
|
||||
class _UTCclass(dt.tzinfo):
|
||||
zone = ... # type: str
|
||||
def fromutc(self, dt: dt.datetime) -> dt.datetime: ...
|
||||
def utcoffset(self, dt: Optional[dt.datetime]) -> dt.timedelta: ... # type: ignore
|
||||
@@ -20,6 +20,7 @@ class UTC(dt.tzinfo):
|
||||
def localize(self, dt: dt.datetime, is_dst: bool=...) -> dt.datetime: ...
|
||||
def normalize(self, dt: dt.datetime, is_dst: bool=...) -> dt.datetime: ...
|
||||
|
||||
utc = ... # type: UTC
|
||||
utc = ... # type: _UTCclass
|
||||
UTC = ... # type: _UTCclass
|
||||
|
||||
def timezone(zone: str) -> UTC: ...
|
||||
def timezone(zone: str) -> dt.tzinfo: ...
|
||||
|
||||
Reference in New Issue
Block a user