Skip to content

Commit

Permalink
[QI2-1068] Replaces | operator with Union for python 3.9 compatibilty
Browse files Browse the repository at this point in the history
  • Loading branch information
NischalQuTech committed Aug 30, 2024
1 parent cf4b242 commit 71ff67e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion qiskit_quantuminspire/qi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def target(self) -> Target:
def max_circuits(self) -> Union[int, None]:
return None

def run(self, run_input: QuantumCircuit | List[QuantumCircuit], **options: Any) -> QIJob:
def run(self, run_input: Union[QuantumCircuit, List[QuantumCircuit]], **options: Any) -> QIJob:
"""Create and run a (batch)job on an QuantumInspire Backend.
Args:
Expand Down
2 changes: 1 addition & 1 deletion qiskit_quantuminspire/qi_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class QIJob(Job): # type: ignore[misc]
def __init__(
self,
run_input: Union[QuantumCircuit, List[QuantumCircuit]],
backend: Backend | None,
backend: Union[Backend, None],
job_id: str,
**kwargs: Any
) -> None:
Expand Down
6 changes: 3 additions & 3 deletions qiskit_quantuminspire/qi_provider.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime, timezone
from typing import Any, List
from typing import Any, List, Union

from compute_api_client import BackendStatus, BackendType, Metadata

Expand Down Expand Up @@ -46,8 +46,8 @@ def _construct_backends(self) -> List[QIBackend]:
]
return qi_backends

def backends(self, name: str | None = None, **kwargs: Any) -> List[QIBackend]:
def backends(self, name: Union[str, None] = None, **kwargs: Any) -> List[QIBackend]:
return self._construct_backends()

def get_backend(self, name: str | None = None, **kwargs: Any) -> QIBackend:
def get_backend(self, name: Union[str, None] = None, **kwargs: Any) -> QIBackend:
return self._construct_backends()[0]

0 comments on commit 71ff67e

Please sign in to comment.