Skip to content

Commit bbf0ac2

Browse files
dlinnemeyermatthiaskramm
authored andcommitted
Fixing timezone utc type (#568)
* switching to timezone type * taking a shot at 2.7
1 parent 76c0850 commit bbf0ac2

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

stdlib/2.7/datetime.pyi

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,7 @@ class tzinfo(object):
1414
def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ...
1515
def fromutc(self, dt: datetime) -> datetime: ...
1616

17-
class timezone(tzinfo):
18-
utc = ... # type: tzinfo
19-
min = ... # type: tzinfo
20-
max = ... # type: tzinfo
21-
22-
def __init__(self, offset: timedelta, name: str = ...) -> None: ...
23-
def __hash__(self) -> int: ...
24-
2517
_tzinfo = tzinfo
26-
_timezone = timezone
2718

2819
class date(object):
2920
min = ... # type: date
@@ -173,7 +164,7 @@ class datetime(object):
173164
def tzinfo(self) -> _tzinfo: ...
174165

175166
@classmethod
176-
def fromtimestamp(cls, t: float, tz: timezone = ...) -> datetime: ...
167+
def fromtimestamp(cls, t: float, tz: _tzinfo = ...) -> datetime: ...
177168
@classmethod
178169
def utcfromtimestamp(cls, t: float) -> datetime: ...
179170
@classmethod

stdlib/3/datetime.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class tzinfo:
1414
def fromutc(self, dt: datetime) -> datetime: ...
1515

1616
class timezone(tzinfo):
17-
utc = ... # type: tzinfo
18-
min = ... # type: tzinfo
19-
max = ... # type: tzinfo
17+
utc = ... # type: timezone
18+
min = ... # type: timezone
19+
max = ... # type: timezone
2020

2121
def __init__(self, offset: timedelta, name: str = ...) -> None: ...
2222
def __hash__(self) -> int: ...

0 commit comments

Comments
 (0)