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

Add Moment.__sub__ and generalize Moment.__add__ #3216

Merged
merged 4 commits into from
Aug 14, 2020
Merged

Add Moment.__sub__ and generalize Moment.__add__ #3216

merged 4 commits into from
Aug 14, 2020

Conversation

Strilanc
Copy link
Contributor

@Strilanc Strilanc commented Aug 14, 2020

  • Moment.__add__ now accepts any OP_TREE
  • Moment.__sub__ takes an OP_TREE and returns a moment with those operations removed
  • If there is an operation-to-remove that was not present, an error is raised
  • Also bump mypy version to fix an incompatibility with python 3.8 and fix new warnings
    • Add explicit !r to format statements touching bytes
    • Rename value_equality.py to avoid name collision with the decorator it defines
    • Ignore false positives related to abstract base type bounds

- Also bump mypy version to fix an incompatibility with python 3.8
- Fix new mypy warnings:
    - Add explicit !r to format statements touching bytes
    - Rename `value_equality.py` to avoid name collision with the decorator it defines
    - Ignore false positives related to abstract base type bounds
@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Aug 14, 2020
@@ -509,7 +508,7 @@ def attempt_sync_with_master(pr: PullRequestDetails
data = {
'base': pr.branch_name,
'head': master_sha,
'commit_message': 'Update branch (automerge)'.format(pr.branch_name)
'commit_message': 'Update branch (automerge)'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original looks like it was accidentally missing a {}. Suggestion:

'commit_message': 'Update branch {pr.branch_name} (automerge)'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was intentional. When I changed it to not mention the branch name I just forgot to remove the format call.

'Code: {}. Content: {}.'.format(response.status_code,
response.content))
'Code: {}. Content: {!r}.'.format(
response.status_code, response.content))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a format string?

(Applies throughout.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged. Wanted to keep the refactoring minimal.

@Strilanc Strilanc added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Aug 14, 2020
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Aug 14, 2020
@CirqBot CirqBot merged commit aff27b8 into master Aug 14, 2020
@CirqBot CirqBot removed the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Aug 14, 2020
@CirqBot CirqBot deleted the sub_moment branch August 14, 2020 18:58
@CirqBot CirqBot removed the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Aug 14, 2020
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 2020
- `Moment.__add__` now accepts any `OP_TREE`
- `Moment.__sub__` takes an `OP_TREE` and returns a moment with those operations removed
- If there is an operation-to-remove that was not present, an error is raised
- Also bump mypy version to fix an incompatibility with python 3.8 and fix new warnings
    - Add explicit !r to format statements touching bytes
    - Rename `value_equality.py` to avoid name collision with the decorator it defines
    - Ignore false positives related to abstract base type bounds
@kevinsung kevinsung mentioned this pull request Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants