summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2020-11-27 23:27:15 -0500
committerDan Halbert <halbert@halwitz.org>2020-11-27 23:27:15 -0500
commit65e2fe46540abc09f341c39d877eafeb791933f1 (patch)
treea6286ab7995229f2c82bc55bc43b9af823e511a3
parentf96475cbbf5417531bbdd302b720658c5fa0f541 (diff)
fix stub problems; touch up doc
-rw-r--r--shared-bindings/_typing/__init__.pyi5
-rw-r--r--shared-bindings/alarm/time/TimeAlarm.c2
-rw-r--r--shared-bindings/microcontroller/__init__.c9
-rw-r--r--tools/extract_pyi.py2
4 files changed, 6 insertions, 12 deletions
diff --git a/shared-bindings/_typing/__init__.pyi b/shared-bindings/_typing/__init__.pyi
index 271693686..cc4a0a439 100644
--- a/shared-bindings/_typing/__init__.pyi
+++ b/shared-bindings/_typing/__init__.pyi
@@ -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.
"""
diff --git a/shared-bindings/alarm/time/TimeAlarm.c b/shared-bindings/alarm/time/TimeAlarm.c
index 6339b850c..17a4faac2 100644
--- a/shared-bindings/alarm/time/TimeAlarm.c
+++ b/shared-bindings/alarm/time/TimeAlarm.c
@@ -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.
diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c
index d09cf8f44..8a77d1df5 100644
--- a/shared-bindings/microcontroller/__init__.c
+++ b/shared-bindings/microcontroller/__init__.c
@@ -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,
diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py
index b7ce584a1..2730102ac 100644
--- a/tools/extract_pyi.py
+++ b/tools/extract_pyi.py
@@ -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):