Skip to content

Commit 14af879

Browse files
authored
Added missing properties to struct_time (#4256)
1 parent fb398b1 commit 14af879

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

stdlib/2and3/time.pyi

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,24 @@ if sys.version_info >= (3, 3) and sys.platform != 'win32':
3131
if sys.version_info >= (3, 8) and sys.platform == "darwin":
3232
CLOCK_UPTIME_RAW: int
3333

34+
class _struct_time(NamedTuple):
35+
tm_year: int
36+
tm_mon: int
37+
tm_mday: int
38+
tm_hour: int
39+
tm_min: int
40+
tm_sec: int
41+
tm_wday: int
42+
tm_yday: int
43+
tm_isdst: int
44+
45+
@property
46+
def n_fields(self) -> int: ...
47+
@property
48+
def n_sequence_fields(self) -> int: ...
49+
@property
50+
def n_unnamed_fields(self) -> int: ...
3451
if sys.version_info >= (3, 3):
35-
class _struct_time(NamedTuple):
36-
tm_year: int
37-
tm_mon: int
38-
tm_mday: int
39-
tm_hour: int
40-
tm_min: int
41-
tm_sec: int
42-
tm_wday: int
43-
tm_yday: int
44-
tm_isdst: int
45-
tm_zone: str
46-
tm_gmtoff: int
4752
class struct_time(_struct_time):
4853
def __init__(
4954
self,
@@ -63,17 +68,11 @@ if sys.version_info >= (3, 3):
6368
],
6469
_arg: Any = ...,
6570
) -> struct_time: ...
71+
@property
72+
def tm_zone(self) -> str: ...
73+
@property
74+
def tm_gmtoff(self) -> int: ...
6675
else:
67-
class _struct_time(NamedTuple):
68-
tm_year: int
69-
tm_mon: int
70-
tm_mday: int
71-
tm_hour: int
72-
tm_min: int
73-
tm_sec: int
74-
tm_wday: int
75-
tm_yday: int
76-
tm_isdst: int
7776
class struct_time(_struct_time):
7877
def __init__(self, o: _TimeTuple, _arg: Any = ...) -> None: ...
7978
def __new__(cls, o: _TimeTuple, _arg: Any = ...) -> struct_time: ...

0 commit comments

Comments
 (0)