Skip to content

Commit 36feb41

Browse files
committed
Fix struct_time type hints
1 parent 1eb0ae6 commit 36feb41

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

shared-bindings/time/__init__.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ static mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, s
8383
}
8484

8585
//| class struct_time:
86+
//| tm_year: int
87+
//| tm_mon: int
88+
//| tm_mday: int
89+
//| tm_hour: int
90+
//| tm_min: int
91+
//| tm_sec: int
92+
//| tm_wday: int
93+
//| tm_yday: int
94+
//| tm_isdst: int
95+
//|
8696
//| def __init__(self, time_tuple: Sequence[int]) -> None:
8797
//| """Structure used to capture a date and time. Can be constructed from a `struct_time`, `tuple`, `list`, or `namedtuple` with 9 elements.
8898
//|
@@ -210,7 +220,7 @@ static mp_obj_t time_monotonic_ns(void) {
210220
}
211221
MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_ns_obj, time_monotonic_ns);
212222

213-
//| def localtime(secs: int) -> struct_time:
223+
//| def localtime(secs: Optional[int] = None) -> struct_time:
214224
//| """Convert a time expressed in seconds since Jan 1, 1970 to a struct_time in
215225
//| local time. If secs is not provided or None, the current time as returned
216226
//| by time() is used.

0 commit comments

Comments
 (0)