micropython: Drop TConst type.

TConst does not exist, so adding it makes it a bit harder to read than needed. The const() "function" will take int or float, and the return value can be used as such, even if it is optimized out. This is described in the docstring, so we can leave out the additional type.

Also adds autofunctions in place of one auto module so we can move things around as needed. Also fix cross links with usys to get the build to pass before we update that module.
This commit is contained in:
Laurens Valk
2021-07-14 14:13:18 +02:00
parent 456dc28c1b
commit c656eae2f3
3 changed files with 19 additions and 8 deletions
+2 -7
View File
@@ -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::