Fix the docstring of CommutationChecker.commute_nodes#15991
Open
Cryoris wants to merge 2 commits intoQiskit:mainfrom
Open
Fix the docstring of CommutationChecker.commute_nodes#15991Cryoris wants to merge 2 commits intoQiskit:mainfrom
CommutationChecker.commute_nodes#15991Cryoris wants to merge 2 commits intoQiskit:mainfrom
Conversation
With the partial type hints the API docs only showed the last 2 parameters instead of all 4. also added some more explanations.
Collaborator
|
One or more of the following people are relevant to this code:
|
jakelishman
reviewed
Apr 10, 2026
| approximation_degree: float = 1.0, | ||
| ) -> bool: | ||
| """Checks if two DAGOpNodes commute.""" | ||
| """Checks if two :class:`.DAGOpNode`\ s commute. |
Member
There was a problem hiding this comment.
Either
Suggested change
| """Checks if two :class:`.DAGOpNode`\ s commute. | |
| """Checks if two :class:`.DAGOpNode`\\ s commute. |
(bad Python escape character) or
Suggested change
| """Checks if two :class:`.DAGOpNode`\ s commute. | |
| """Checks if two :class:`.DAGOpNode` objects commute. |
The docs team usually prefer the second because it's easier to translate or to read for less-fluent English speakers.
Member
There was a problem hiding this comment.
I'm fairly sure pylint used to complain about this, but it looks like Ruff doesn't.
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.
I came across this during reviewing Matt's cache PR: With the partial type hints the API docs only showed the last 2 parameters instead of all 4.
Also added some more explanations.
AI/LLM disclosure