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, NoReturn
13 Fun = TypeVar("Fun", bound=Callable[..., Any])
15 def const(x: int) -> int:
16 "Emulate making a constant"
19 def native(f: Fun) -> Fun:
20 "Emulate making a native"
23 def viper(f: Fun) -> NoReturn:
24 "User is attempting to use a viper code emitter"
25 raise SyntaxError("invalid micropython decorator")
27 def asm_thumb(f: Fun) -> NoReturn:
28 "User is attempting to use an inline assembler"
29 raise SyntaxError("invalid micropython decorator")