This requires converting it into a package so that it can have a
"py.typed" file.
After this, a package using micropython.const can be type checked
"adafruit_blinka.microcontroller.bcm283x.pulseio": [
"libgpiod_pulsein",
"libgpiod_pulsein64",
"adafruit_blinka.microcontroller.bcm283x.pulseio": [
"libgpiod_pulsein",
"libgpiod_pulsein64",
+ ],
+ "micropython": ["py.typed"],
},
install_requires=[
"Adafruit-PlatformDetect>=3.13.0",
},
install_requires=[
"Adafruit-PlatformDetect>=3.13.0",
+from typing import Callable, TypeVar, Any
+Fun = TypeVar("Fun", bound=Callable[..., Any])
+
+
+def const(x: int) -> int:
"Emulate making a constant"
return x
"Emulate making a constant"
return x
+def native(f: Fun) -> Fun:
"Emulate making a native"
return f
"Emulate making a native"
return f
+def viper(f: Fun) -> None:
"User is attempting to use a viper code emitter"
raise SyntaxError("invalid micropython decorator")
"User is attempting to use a viper code emitter"
raise SyntaxError("invalid micropython decorator")
+def asm_thumb(f: Fun) -> None:
"User is attempting to use an inline assembler"
raise SyntaxError("invalid micropython decorator")
"User is attempting to use an inline assembler"
raise SyntaxError("invalid micropython decorator")