Skip to content

Added missing properties to struct_time #4256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 21 additions & 22 deletions stdlib/2and3/time.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,24 @@ if sys.version_info >= (3, 3) and sys.platform != 'win32':
if sys.version_info >= (3, 8) and sys.platform == "darwin":
CLOCK_UPTIME_RAW: int

class _struct_time(NamedTuple):
tm_year: int
tm_mon: int
tm_mday: int
tm_hour: int
tm_min: int
tm_sec: int
tm_wday: int
tm_yday: int
tm_isdst: int

@property
def n_fields(self) -> int: ...
@property
def n_sequence_fields(self) -> int: ...
@property
def n_unnamed_fields(self) -> int: ...
if sys.version_info >= (3, 3):
class _struct_time(NamedTuple):
tm_year: int
tm_mon: int
tm_mday: int
tm_hour: int
tm_min: int
tm_sec: int
tm_wday: int
tm_yday: int
tm_isdst: int
tm_zone: str
tm_gmtoff: int
class struct_time(_struct_time):
def __init__(
self,
Expand All @@ -63,17 +68,11 @@ if sys.version_info >= (3, 3):
],
_arg: Any = ...,
) -> struct_time: ...
@property
def tm_zone(self) -> str: ...
@property
def tm_gmtoff(self) -> int: ...
else:
class _struct_time(NamedTuple):
tm_year: int
tm_mon: int
tm_mday: int
tm_hour: int
tm_min: int
tm_sec: int
tm_wday: int
tm_yday: int
tm_isdst: int
class struct_time(_struct_time):
def __init__(self, o: _TimeTuple, _arg: Any = ...) -> None: ...
def __new__(cls, o: _TimeTuple, _arg: Any = ...) -> struct_time: ...
Expand Down