Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing of the protocols.commutes() function #5651

Merged
merged 5 commits into from Jul 1, 2022

Conversation

pavoljuhas
Copy link
Collaborator

@pavoljuhas pavoljuhas commented Jun 29, 2022

Return bool when the default argument is not specified.
Otherwise allow return type to be the same as the default argument type.

Co-authored-by: Matthew Neeley maffoo@google.com

Require the `default` argument of the `commutes()` function
to be bool, None, or a local marker-type for raising TypeError.
Use dedicated local marker-type _TRaiseTypeErrorIfNotProvided
instead of np.array instance.
@pavoljuhas pavoljuhas requested review from a team, vtomole and cduck as code owners June 29, 2022 23:19
@pavoljuhas pavoljuhas requested a review from maffoo June 29, 2022 23:19
@CirqBot CirqBot added the size: S 10< lines changed <50 label Jun 29, 2022
Return bool when the `default` argument is not specified.
Otherwise allow return type to be the same as the `default` argument type.
@pavoljuhas pavoljuhas changed the title Fix typing of the default argument in protocols.commutes Fix typing of the protocols.commutes() function Jun 30, 2022
@pavoljuhas pavoljuhas added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jun 30, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jun 30, 2022
@CirqBot
Copy link
Collaborator

CirqBot commented Jun 30, 2022

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jun 30, 2022
@pavoljuhas pavoljuhas added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 1, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 1, 2022
@CirqBot CirqBot merged commit db7de00 into quantumlib:master Jul 1, 2022
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jul 1, 2022
@pavoljuhas pavoljuhas deleted the fix-mypy-numpy-errors-1 branch July 1, 2022 17:19
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Return bool when the `default` argument is not specified.
Otherwise allow return type to be the same as the `default` argument type.

Co-authored-by: Matthew Neeley <maffoo@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants