Skip to content

Commit 4795e54

Browse files
authored
Merge pull request #10109 from jepler/any-display-union
Add typing shorthand for display-related types
2 parents a1f4eea + c61895e commit 4795e54

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,8 @@ stubs:
265265
@mkdir circuitpython-stubs
266266
@$(PYTHON) tools/extract_pyi.py shared-bindings/ $(STUBDIR)
267267
@$(PYTHON) tools/extract_pyi.py extmod/ulab/code/ $(STUBDIR)/ulab
268-
@$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR)
269-
@$(PYTHON) tools/extract_pyi.py ports/espressif/bindings $(STUBDIR)
270-
@$(PYTHON) tools/extract_pyi.py ports/raspberrypi/bindings $(STUBDIR)
268+
@for d in ports/*/bindings; do \
269+
$(PYTHON) tools/extract_pyi.py "$$d" $(STUBDIR); done
271270
@sed -e "s,__version__,`python -msetuptools_scm`," < setup.py-stubs > circuitpython-stubs/setup.py
272271
@cp README.rst-stubs circuitpython-stubs/README.rst
273272
@cp MANIFEST.in-stubs circuitpython-stubs/MANIFEST.in

ports/zephyr-cp/bindings/zephyr_serial/UART.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
//| class UART:
2626
//| """A bidirectional serial protocol. Already initialized for Zephyr defined
27-
//| busses in `board`.
27+
//| busses in :py:mod:`board`.
2828
//|
2929
//| .. raw:: html
3030
//|

shared-bindings/displayio/__init__.c

+17
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@
4545
//| """
4646
//|
4747

48+
//| AnyDisplayBus = fourwire.FourWire | i2cdisplaybus.I2CDisplayBus | is31fl3741.IS31FL3741
49+
//| """Type-checking shorthand for any kind of display bus. Not actually defined in CircuitPython."""
50+
//|
51+
//| AnyFramebuffer = (
52+
//| rgbmatrix.RGBMatrix
53+
//| | is31fl3741.IS31FL3741_FrameBuffer
54+
//| | sharpdisplay.SharpMemoryFramebuffer
55+
//| | videocore.Framebuffer
56+
//| | picodvi.Framebuffer
57+
//| | aurora_epaper.AuroraMemoryFramebuffer
58+
//| )
59+
//| """Type-checking shorthand for any kind of framebuffer. Not actually defined in CircuitPython."""
60+
//|
61+
//| AnyDisplay = (
62+
//| busdisplay.BusDisplay | epaperdisplay.EPaperDisplay | framebufferio.FramebufferDisplay
63+
//| )
64+
//| """Type-checking shorthand for any kind of display. Not actually defined in CircuitPython."""
4865
//| CIRCUITPYTHON_TERMINAL: Group
4966
//| """The `displayio.Group` that is the displayed serial terminal (REPL)."""
5067
//|

shared-bindings/supervisor/Runtime.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,12 @@ MP_PROPERTY_GETSET(supervisor_runtime_rgb_status_brightness_obj,
208208
(mp_obj_t)&supervisor_runtime_set_rgb_status_brightness_obj);
209209

210210
#if CIRCUITPY_DISPLAYIO
211-
//| display: Any
211+
//| display: displayio.AnyDisplay | None
212212
//| """The primary configured displayio display, if any.
213213
//|
214214
//| If the board has a display that is hard coded, or that was explicitly set
215215
//| in boot.py or code.py (including a previous run of code.py), it is
216-
//| available here until it is released with ``displayio.releasee_displays()``.
216+
//| available here until it is released with ``displayio.release_displays()``.
217217
//|
218218
//| The display can be of any supported display type, such as `busdisplay.BusDisplay`.
219219
//|

0 commit comments

Comments
 (0)