docs/machine/Signal: Clarify constructor behavior.#19342
Open
hlovatt wants to merge 1 commit into
Open
Conversation
Signed-off-by: Howard Lovatt <howard.lovatt@gmail.com>
dpgeorge
reviewed
Jun 17, 2026
|
|
||
| .. note:: | ||
| If the pin is inverted *and* an initial value is given, then the two constructors | ||
| behave differently before a subsequent 'set'. |
Member
There was a problem hiding this comment.
The constructors themselves don't really behave differently. Rather it's where you put the value=.
Eg if you had two value= then it'd be different again:
Signal(Pin(0, Pin.OUT, value=0), value=0, invert=True)So I think this needs to be reworded. Something along the lines of "The value of the pin can be set in the Pin constructor and the Signal constructor. If the Signal is also inverted then an value set in the Pin constructor will be opposite".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Howard Lovatt howard.lovatt@gmail.com
Summary
The behaviour of the two constructors have a subtle difference that is worth documenting.
Testing
None. It's a doc change only.
Trade-offs and Alternatives
The two constructors could be made to behave the same.
However dpgeorge thought documenting the differences was a superior approach.
See #19263.
Generative AI
I did not use generative AI tools when creating this PR.
I used generative AI tools when creating this PR, but a human has checked the
code and is responsible for the code and the description above.