diff --git a/doc/main/micropython/micropython.rst b/doc/main/micropython/micropython.rst index 99c2482..0dcc304 100644 --- a/doc/main/micropython/micropython.rst +++ b/doc/main/micropython/micropython.rst @@ -2,3 +2,19 @@ =========================================== .. automodule:: micropython + :no-members: + +.. autofunction:: micropython.const + +.. autofunction:: micropython.opt_level + +.. autofunction:: micropython.mem_info + +.. autofunction:: micropython.qstr_info + +.. autofunction:: micropython.stack_use + +.. autofunction:: micropython.kbd_intr + + + diff --git a/src/micropython/__init__.py b/src/micropython/__init__.py index b8e1b1e..3b45de9 100644 --- a/src/micropython/__init__.py +++ b/src/micropython/__init__.py @@ -9,15 +9,10 @@ Access and control MicroPython internals. """ -from typing import Any, Literal, TypeVar, overload - -TConst = TypeVar("TConst", int, float) -""" -Allowable types for :meth:`const`. -""" +from typing import Any, Literal, Union, overload -def const(expr: TConst) -> TConst: +def const(expression: Union[int, float]) -> Union[int, float]: """ Used to declare that the expression is a constant so that the compile can optimise it. The use of this function should be as follows:: diff --git a/src/usys/__init__.py b/src/usys/__init__.py index 2d9e5a6..f400afc 100644 --- a/src/usys/__init__.py +++ b/src/usys/__init__.py @@ -22,7 +22,7 @@ Stream object that receives input from a connected terminal, if any. Writing may modify newline characters. Use ``usys.stdin.buffer`` instead if this is undesirable. -Also see :meth:`micropython.kbd_intr` to disable ``KeyboardInterrupt`` if you +Also see :func:`micropython.kbd_intr` to disable ``KeyboardInterrupt`` if you are passing binary data via ``stdin``. """