Skip to content

MicroPython/CircuitPython compatibility and CPython 3.12 fixes - #10

Merged
bdbarnett merged 1 commit into
mainfrom
cursor/micropython-compat-0555
Jul 15, 2026
Merged

MicroPython/CircuitPython compatibility and CPython 3.12 fixes#10
bdbarnett merged 1 commit into
mainfrom
cursor/micropython-compat-0555

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

Summary

Restores pydisplay example matrix compatibility after pdwidgets moved to its own repo.

Fixes

  1. MicroPython/CircuitPython — replace keyword-argument super().__init__(...) and internal Widget / Icon / Label constructor calls with positional args (TypeError: function doesn't take keyword arguments).
  2. CPython 3.12 — simplify Widget.add_event_cb signature (no forward-ref Widget | None annotation evaluated at class body scope).
  3. widgets_percent — re-export pct from pdwidgets/__init__.py (from pdwidgets import pct).
  4. graphics clip — import ClippedCanvas from graphics with graphics._clip fallback.
  5. MicroPython — replace contextlib.suppress in spinner/toast with try/except.

Testing

PYTHONPATH=tests/stubs:src:<pydisplay>/src/lib python3 -m unittest discover -s tests

With pydisplay siblings on path and patches applied, 22/22 palettes+pdwidgets examples pass on CPython and MicroPython (see pydisplay#78).

- Use positional super().__init__ and child Widget calls (MCU keyword limits)
- Re-export pct submodule for widgets_percent
- Import ClippedCanvas from graphics with _clip fallback
- Replace contextlib.suppress with try/except in spinner/toast
- Simplify add_event_cb signature (no forward-ref type hint)

Paired with pydisplay PR #78 example matrix validation.
@cursor

cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@bdbarnett
bdbarnett merged commit 7b1ac03 into main Jul 15, 2026
1 of 2 checks passed
@bdbarnett
bdbarnett deleted the cursor/micropython-compat-0555 branch July 15, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants