Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions python-ecosys/astpp/astpp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
try:
from micropython import const
except ImportError:

def const(x):
return x


def keep(obj):
return obj


def omit(obj):
return None


def keep_if(cond):
return keep if cond else omit


def omit_if(cond):
return omit if cond else keep


try:
import micropython as _real_mpy
except ImportError:
_real_mpy = None
if _real_mpy is not None:
micropython = _real_mpy
else:

class _MicroPythonShim:
native = staticmethod(keep)
viper = staticmethod(keep)

micropython = _MicroPythonShim()
__version__ = "0.1.3"
3 changes: 3 additions & 0 deletions python-ecosys/astpp/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
metadata(version="0.1.3", pypi="astpp")

module("astpp.py")
Loading