1 # SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
3 # SPDX-License-Identifier: MIT
5 `micropython` - MicroPython Specific Decorator Functions
6 ========================================================
11 from typing import Callable, TypeVar, Any
13 Fun = TypeVar("Fun", bound=Callable[..., Any])
16 def const(x: int) -> int:
17 "Emulate making a constant"
21 def native(f: Fun) -> Fun:
22 "Emulate making a native"
26 def viper(f: Fun) -> None:
27 "User is attempting to use a viper code emitter"
28 raise SyntaxError("invalid micropython decorator")
31 def asm_thumb(f: Fun) -> None:
32 "User is attempting to use an inline assembler"
33 raise SyntaxError("invalid micropython decorator")