-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #610 from adafruit/micropython-pyi
Provide stubs for micropython module in a more clearly compatible way
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries | ||
# | ||
# SPDX-License-Identifier: MIT | ||
""" | ||
`micropython` - MicroPython Specific Decorator Functions | ||
======================================================== | ||
* Author(s): cefn | ||
""" | ||
|
||
from typing import Callable, TypeVar, Any, NoReturn | ||
|
||
Fun = TypeVar("Fun", bound=Callable[..., Any]) | ||
|
||
def const(x: int) -> int: | ||
"Emulate making a constant" | ||
|
||
def native(f: Fun) -> Fun: | ||
"Emulate making a native" | ||
|
||
def viper(f: Fun) -> NoReturn: | ||
"User is attempting to use a viper code emitter" | ||
|
||
def asm_thumb(f: Fun) -> NoReturn: | ||
"User is attempting to use an inline assembler" |