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[T](x: T) -> T:
16 "Emulate making a constant"
18 def native(f: Fun) -> Fun:
19 "Emulate making a native"
21 def viper(f: Fun) -> NoReturn:
22 "User is attempting to use a viper code emitter"
24 def asm_thumb(f: Fun) -> NoReturn:
25 "User is attempting to use an inline assembler"