8000 Merge pull request #4767 from jposada202020/parameter_union_doc_example · michthom/circuitpython@c2ebe55 · GitHub
[go: up one dir, main page]

Skip to content

Commit c2ebe55

Browse files
authored
Merge pull request adafruit#4767 from jposada202020/parameter_union_doc_example
adding parameter documentation explanation when it could have two differents types
2 parents 0ac107b + 82677dd commit c2ebe55

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/design_guide.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,32 @@ To add different types outside CircuitPython you need to include them in the int
332332
The intersphinx_mapping above includes references to Python, BusDevice and CircuitPython
333333
Documentation
334334

335+
When the parameter have two different types, you should reference them as follows::
336+
337+
338+
class Character_LCD:
339+
"""Base class for character LCD
340+
341+
:param ~digitalio.DigitalInOut rs: The reset data line
342+
:param ~pwmio.PWMOut,~digitalio.DigitalInOut blue: Blue RGB Anode
343+
344+
"""
345+
346+
def __init__(self, rs, blue):
347+
self._rc = rs
348+
self.blue = blue
349+
350+
351+
Renders as:
352+
353+
.. py:class:: Character_LCD(rs, blue)
354+
:noindex:
355+
356+
Base class for character LCD
357+
358+
:param ~digitalio.DigitalInOut rs: The reset data line
359+
:param ~pwmio.PWMOut,~digitalio.DigitalInOut blue: Blue RGB Anode
360+
335361

336362
param_name
337363
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)
0