42
42
//| written in MicroPython will work in CPython but not necessarily the other
43
43
//| way around."""
44
44
//|
45
- //| def monotonic() -> Any :
45
+ //| def monotonic() -> float :
46
46
//| """Returns an always increasing value of time with an unknown reference
47
47
//| point. Only use it to compare against other values from `monotonic`.
48
48
//|
@@ -57,7 +57,7 @@ STATIC mp_obj_t time_monotonic(void) {
57
57
}
58
58
MP_DEFINE_CONST_FUN_OBJ_0 (time_monotonic_obj , time_monotonic );
59
59
60
- //| def sleep(seconds: float) -> Any :
60
+ //| def sleep(seconds: float) -> None :
61
61
//| """Sleep for a given number of seconds.
62
62
//|
63
63
//| :param float seconds: the time to sleep in fractional seconds"""
@@ -93,7 +93,7 @@ mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp
93
93
}
94
94
95
95
//| class struct_time:
96
- //| def __init__(self, time_tuple: Any ) -> None:
96
+ //| def __init__(self, time_tuple: tuple ) -> None:
97
97
//| """Structure used to capture a date and time. Note that it takes a tuple!
98
98
//|
99
99
//| :param tuple time_tuple: Tuple of time info: ``(tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday, tm_yday, tm_isdst)``
@@ -198,7 +198,7 @@ mp_obj_t MP_WEAK rtc_get_time_source_time(void) {
198
198
mp_raise_RuntimeError (translate ("RTC is not supported on this board" ));
199
199
}
200
200
201
- //| def time() -> Any :
201
+ //| def time() -> int :
202
202
//| """Return the current time in seconds since since Jan 1, 1970.
203
203
//|
204
204
//| :return: the current time
@@ -214,7 +214,7 @@ STATIC mp_obj_t time_time(void) {
214
214
}
215
215
MP_DEFINE_CONST_FUN_OBJ_0 (time_time_obj , time_time );
216
216
217
- //| def monotonic_ns() -> Any :
217
+ //| def monotonic_ns() -> int :
218
218
//| """Return the time of the specified clock clk_id in nanoseconds.
219
219
//|
220
220
//| :return: the current time
@@ -227,7 +227,7 @@ STATIC mp_obj_t time_monotonic_ns(void) {
227
227
}
228
228
MP_DEFINE_CONST_FUN_OBJ_0 (time_monotonic_ns_obj , time_monotonic_ns );
229
229
230
- //| def localtime(secs: Any ) -> Any :
230
+ //| def localtime(secs: int ) -> struct_time :
231
231
//| """Convert a time expressed in seconds since Jan 1, 1970 to a struct_time in
232
232
//| local time. If secs is not provided or None, the current time as returned
233
233
//| by time() is used.
@@ -260,7 +260,7 @@ STATIC mp_obj_t time_localtime(size_t n_args, const mp_obj_t *args) {
260
260
}
261
261
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (time_localtime_obj , 0 , 1 , time_localtime );
262
262
263
- //| def mktime(t: Any ) -> Any :
263
+ //| def mktime(t: struct_time ) -> int :
264
264
//| """This is the inverse function of localtime(). Its argument is the
265
265
//| struct_time or full 9-tuple (since the dst flag is needed; use -1 as the
266
266
//| dst flag if it is unknown) which expresses the time in local time, not UTC.
0 commit comments