Skip to content

Fix material_design palette on MicroPython and CircuitPython - #5

Merged
bdbarnett merged 2 commits into
mainfrom
cursor/micropython-zip-strict-0555
Jul 15, 2026
Merged

Fix material_design palette on MicroPython and CircuitPython#5
bdbarnett merged 2 commits into
mainfrom
cursor/micropython-zip-strict-0555

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

Summary

Fixes get_palette(name="material_design") on MicroPython and CircuitPython.

MicroPython does not support strict=True on zip(). MDPalette._define_named_colors used zip(FAMILIES, LENGTHS, strict=True), which raised TypeError: function doesn't take keyword arguments and broke pydisplay examples such as calc_graphics and palettes_demo (material step).

Change

Replace zip(..., strict=True) with an explicit length check plus plain zip(FAMILIES, LENGTHS).

Testing

PYTHONPATH=src python3 -m unittest discover -s tests

MicroPython smoke:

micropython -c "import sys; sys.path.insert(0,'src'); from palettes import get_palette; get_palette('material_design')"

Paired with pydisplay#78.

Replace zip(..., strict=True) with an explicit length check. MicroPython
does not support the strict keyword on zip, which broke get_palette when
name is material_design (e.g. calc_graphics, palettes_demo).
@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 c7fc76e into main Jul 15, 2026
2 checks passed
@bdbarnett
bdbarnett deleted the cursor/micropython-zip-strict-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