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

Deprecate passing None to DAGCircuit appenders #10752

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

jakelishman
Copy link
Member

Summary

This has been against the documented typing of the functions for some time, but some scheduling methods have mistakenly been passing None. There is no need to support None here; the empty tuple () is equally immutable and a CPython singleton, so there are neither mutability nor memory benefits to supporting both, and removing None as an input is a simple way to remove a(n admittedly cheap) branch from the appender methods.

Details and comments

I also made Qiskit/qiskit-ibm-provider#721 to fix the same mistake that the IBM Provider inherited from Terra.

This has been against the documented typing of the functions for some
time, but some scheduling methods have mistakenly been passing `None`.
There is no need to support `None` here; the empty tuple `()` is equally
immutable and a CPython singleton, so there are neither mutability nor
memory benefits to supporting both, and removing `None` as an input is a
simple way to remove a(n admittedly cheap) branch from the appender
methods.
@jakelishman jakelishman added the Changelog: Deprecation Include in "Deprecated" section of changelog label Aug 31, 2023
@jakelishman jakelishman added this to the 0.45.0 milestone Aug 31, 2023
@jakelishman jakelishman requested a review from a team as a code owner August 31, 2023 15:00
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6039053966

  • 19 of 19 (100.0%) changed or added relevant lines in 1 file are covered.
  • 11 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.004%) to 87.292%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 5 91.39%
crates/qasm2/src/parse.rs 6 97.6%
Totals Coverage Status
Change from base Build 6037904724: -0.004%
Covered Lines: 74418
Relevant Lines: 85252

💛 - Coveralls

@1ucian0 1ucian0 self-assigned this Oct 10, 2023
Copy link
Member

@1ucian0 1ucian0 left a comment

Choose a reason for hiding this comment

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

Very small comment (actually, not a breaking change, I'm taking it back) the rest is ready to be merged

1ucian0
1ucian0 previously approved these changes Oct 16, 2023
@1ucian0 1ucian0 enabled auto-merge October 16, 2023 14:18
@jakelishman jakelishman disabled auto-merge October 16, 2023 15:12
@jakelishman
Copy link
Member Author

That latest merge commit didn't quite work right - I've just forced pushed a fixed merge commit in 7502f16.

@jakelishman jakelishman requested a review from 1ucian0 October 16, 2023 22:48
@1ucian0 1ucian0 enabled auto-merge October 18, 2023 11:16
@1ucian0 1ucian0 added this pull request to the merge queue Oct 18, 2023
Merged via the queue into Qiskit:main with commit b18faa3 Oct 18, 2023
13 checks passed
@jakelishman jakelishman deleted the dag-deprecate-none-args branch October 18, 2023 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Deprecation Include in "Deprecated" section of changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants