8000 Add typing shorthand for display-related types · jepler/circuitpython@674b7af · GitHub
[go: up one dir, main page]

Skip to content

Commit 674b7af

Browse files
committed
Add typing shorthand for display-related types
.. and use it to give a better type hint for supervisor.runtime.display.
1 parent de2dd2d commit 674b7af

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

shared-bindings/displayio/__init__.c

Expand all lines: shared-bindings/displayio/__init__.c
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@
4545
//| """
4646
//|
4747

48+
//| AnyDisplayBus: fourwire.FourWire | i2cdisplaybus.I2cDisplayBus
49+
//| """Type-checking shorthand for any kind of display bus. Not actually defined in CircuitPython."""
50+
//|
51+
//| AnyFramebuffer: (
52+
//| rgbmatrix.RGBMatrix
53+
//| | 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ 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

0 commit comments

Comments
 (0)
0