Skip to content

Commit 559a72b

Browse files
committed
Use stub for micropython module doc generation
1 parent 2b77a6f commit 559a72b

File tree

3 files changed

+5
-166
lines changed

3 files changed

+5
-166
lines changed

docs/library/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ the following libraries.
5454
.. toctree::
5555
:maxdepth: 1
5656

57-
micropython.rst
57+
../../shared-bindings/micropython/index.rst

docs/library/micropython.rst

Lines changed: 0 additions & 157 deletions
This file was deleted.

stubs/micropython/__init__.pyi

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
"""Access and control MicroPython internals"""
22

3-
from typing import TypeVar
4-
5-
T = TypeVar("T")
6-
7-
def const(expr: T) -> T:
3+
def const[T](expr: T) -> T:
84
"""Used to declare that the expression is a constant so that the compiler
9-
can optimise it. The use of this function should be as follows:
5+
can optimise it. The use of this function should be as follows::
106
117
from micropython import const
128
@@ -18,7 +14,7 @@ def const(expr: T) -> T:
1814
begins with an underscore then it is hidden, it is not available as a global
1915
variable, and does not take up any memory during execution.
2016
21-
This const function is recognised directly by the MicroPython parser and is
22-
provided as part of the micropython module mainly so that scripts can be
17+
This `const` function is recognised directly by the MicroPython parser and is
18+
provided as part of the :mod:`micropython` module mainly so that scripts can be
2319
written which run under both CPython and MicroPython, by following the above
2420
pattern."""

0 commit comments

Comments
 (0)