Add supported_versions to openqasm3.spec. #513
Merged
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.
Summary
List the supported specification versions in the
openqasm3
package.Details and comments
In #508 and the following OpenQASM TSC meeting it was discussed that the
openqasm3
Python package version would be separate from that of the specification and that the package would support multiple specification versions. Thus it would be useful to list somewhere in theopenqasm3
package which versions of the specification are supported.I considered adding a simple
SpecVersion
class, but I wasn't sure it was worth the (small) amount of complexity. A comparable specification version might be useful, but in the AST rather than this list of versions (e.g. so that users of the AST could check whether a version was> SpecVersion(3, 1)
).I'm happy to add a
SpecVersion
class and also use it in the AST, but I thought I'd start with this simpler implementation.Checklist
✅ I have added the tests to cover my changes.
✅ I have updated the documentation accordingly.
✅ I have read the CONTRIBUTING document.