fix stub problems; touch up doc

This commit is contained in:
Dan Halbert 2020-11-27 23:27:15 -05:00
parent f96475cbbf
commit 65e2fe4654
4 changed files with 6 additions and 12 deletions

View File

@ -2,6 +2,9 @@
from typing import Union
import alarm
import alarm.pin
import alarm.time
import array
import audiocore
import audiomixer
@ -61,5 +64,5 @@ Alarm = Union[
- `alarm.pin.PinAlarm`
- `alarm.time.TimeAlarm`
You can use these alarms to wake from light or deep sleep.
You can use these alarms to wake up from light or deep sleep.
"""

View File

@ -43,7 +43,7 @@ mp_obj_t MP_WEAK rtc_get_time_source_time(void) {
//| class TimeAlarm:
//| """Trigger an alarm when the specified time is reached."""
//|
//| def __init__(self, monotonic_time: Optional[Float] = None, epoch_time: Optional[int] = None) -> None:
//| def __init__(self, monotonic_time: Optional[float] = None, epoch_time: Optional[int] = None) -> None:
//| """Create an alarm that will be triggered when `time.monotonic()` would equal
//| ``monotonic_time``, or when `time.time()` would equal ``epoch_time``.
//| Only one of the two arguments can be given.

View File

@ -147,15 +147,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_reset_obj, mcu_reset);
//| This object is the sole instance of `watchdog.WatchDogTimer` when available or ``None`` otherwise."""
//|
//| """:mod:`microcontroller.pin` --- Microcontroller pin names
//| --------------------------------------------------------
//|
//| .. module:: microcontroller.pin
//| :synopsis: Microcontroller pin names
//|
//| References to pins as named by the microcontroller"""
//|
const mp_obj_module_t mcu_pin_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&mcu_pin_globals,

View File

@ -19,7 +19,7 @@ import black
IMPORTS_IGNORE = frozenset({'int', 'float', 'bool', 'str', 'bytes', 'tuple', 'list', 'set', 'dict', 'bytearray', 'slice', 'file', 'buffer', 'range', 'array', 'struct_time'})
IMPORTS_TYPING = frozenset({'Any', 'Optional', 'Union', 'Tuple', 'List', 'Sequence', 'NamedTuple', 'Iterable', 'Iterator', 'Callable', 'AnyStr', 'overload', 'Type'})
IMPORTS_TYPES = frozenset({'TracebackType'})
CPY_TYPING = frozenset({'ReadableBuffer', 'WriteableBuffer', 'AudioSample', 'FrameBuffer'})
CPY_TYPING = frozenset({'ReadableBuffer', 'WriteableBuffer', 'AudioSample', 'FrameBuffer', 'Alarm'})
def is_typed(node, allow_any=False):