• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 18712519024
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: gh-readonly-queue/main/pr-15242-97bca22b256edfd14d1b403a30de1efef2453eb5
DEFAULT BRANCH: main
Ran 22 Oct 2025 10:37AM UTC
Jobs 1
Files 867
Run time 7min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Oct 2025 09:59AM UTC coverage: 88.42% (+0.01%) from 88.408%
18712519024

push

github

web-flow
Document subclass considerations for `Target` (#15220) (#15231)

* Document subclass considerations for `Target`

The documentation of `Target` previously implied that subclassing it is
ok, and we have users that have done that.  However, subclassing it is
fragile, does not affect any transpiler pass that reads from the
`Target` in Rust space, and requires the subclass to arrange for
`__new__` to be called correctly.  I re-added a `**kwargs` variadic in
`Target.__new__` as a minor convenience; subclasses that only add
keyword-only arguments (which are generally the safest things to add)
will remain functional.  Had `Target.__new__` been defined in terms of
keyword-only arguments, we could also have added an `*args` munch too,
but as it is, adding or modifying the positional arguments to a `Target`
subclass constructor _always_ requires overriding `__new__` as well to
avoid clobbering positional `description`, `num_qubits`, etc, so there's
no benefit to having `*args`.

We should be discouraging users from subclassing `Target`; even our own
subclass of the Python-space `Target` from the Rust-space `Target` is
rather fragile with how we attempt to keep data in sync between the two.
Most APIs exposing a `Target` to their users would probably be better as
constructor functions; this is supposed to be the default way of
building a `Target`.

* Reexplain constructors vs subclassing

---------


(cherry picked from commit b6484afde)

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>

1 of 1 new or added line in 1 file covered. (100.0%)

10 existing lines in 3 files now uncovered.

92391 of 104491 relevant lines covered (88.42%)

539354.87 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
82.79
0.0% crates/circuit/src/parameter/parameter_expression.rs
4
92.01
-0.26% crates/qasm2/src/lex.rs
5
72.98
-0.16% crates/circuit/src/parameter/symbol_expr.rs
Jobs
ID Job ID Ran Files Coverage
1 18712519024.1 22 Oct 2025 10:37AM UTC 867
88.42
GitHub Action Run
Source Files on build 18712519024
  • Tree
  • List 867
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #18712519024
  • adf7b04b on github
  • Prev Build on gh-readonly-queue/stable/2.2/pr-15230-73a0c7e1327828d13edf53666e30049191cd4a2a (#18709871075)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc