Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions source/pip/qsharp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@
BitFlipNoise,
PhaseFlipNoise,
CircuitGenerationMethod,
QdkContext,
new_context,
get_context,
context_of,
)

# Backward-compatible alias
QSharpContext = QdkContext
Comment on lines +30 to +31
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

QSharpContext is introduced as a backward-compatible alias, but it isn’t included in __all__. If users rely on from qsharp import * (or tooling that uses __all__) this breaks the backward-compatibility story. Consider adding \"QSharpContext\" to __all__.

Copilot uses AI. Check for mistakes.

telemetry_events.on_import()

from ._native import Result, Pauli, QSharpError, TargetProfile, estimate_custom
Expand Down Expand Up @@ -62,4 +69,8 @@
"BitFlipNoise",
"PhaseFlipNoise",
"CircuitGenerationMethod",
"QdkContext",
"new_context",
"get_context",
"context_of",
]
4 changes: 2 additions & 2 deletions source/pip/qsharp/_ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from IPython.display import display, Javascript, clear_output
from IPython.core.magic import register_cell_magic
from ._native import QSharpError
from ._qsharp import get_interpreter, qsharp_value_to_python_value
from ._qsharp import _get_default_ctx, qsharp_value_to_python_value
from . import telemetry_events
import pathlib

Expand All @@ -37,7 +37,7 @@ def callback(output):

try:
results = qsharp_value_to_python_value(
get_interpreter().interpret(cell, callback)
_get_default_ctx()._interpreter.interpret(cell, callback)
)

durationMs = (monotonic() - start_time) * 1000
Expand Down
Loading
Loading