- Treat QuecPython runtime as the target, not CPython.
- Prefer QuecPython modules in device code:
ujson,utime,uos,usocket,ure,_thread. - Avoid unsupported or risky syntax in project baseline:
f-strings, walrus operator (
:=),nonlocal, type annotations in runtime files. - Avoid CPython-only imports in runtime files:
typing,pathlib,threading,asyncio,subprocess. - Guard all network and I/O calls with: timeout, retries/backoff, exception handling, and clear logs.
Host scripts (tooling, build, VSCode integration) may use CPython features.
Do not copy host-side imports/patterns directly into /usr runtime code.
- Keep entry file simple (
_main.pyor project entry). - Keep long-running loops interruptible and observable.
- Log key transitions: boot, network ready, connect/reconnect, upload, failure reason.
- Keep file writes bounded and avoid high-frequency flash writes.