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

Fix stim.pyi that includes stim.CircuitOperation #858

Open
nelimee opened this issue Nov 21, 2024 · 1 comment
Open

Fix stim.pyi that includes stim.CircuitOperation #858

nelimee opened this issue Nov 21, 2024 · 1 comment

Comments

@nelimee
Copy link
Contributor

nelimee commented Nov 21, 2024

The __init__.pyi file that is used for Python typing includes the following lines:

@overload
def append(
self,
name: str,
targets: Union[int, stim.GateTarget, Iterable[Union[int, stim.GateTarget]]],
arg: Union[float, Iterable[float]],
) -> None:
pass
@overload
def append(
self,
name: Union[stim.CircuitOperation, stim.CircuitRepeatBlock],
) -> None:
pass
def append(
self,
name: object,
targets: object = (),
arg: object = None,
) -> None:

In particular, one of the overloads of Circuit.append is type-annotated with stim.CircuitOperation which seems like a typo/outdated reference to stim.CircuitInstruction:

def append(
self,
name: Union[stim.CircuitOperation, stim.CircuitRepeatBlock],
) -> None:

This causes issues with type checkers, at least with Pyright in strict mode.

@Strilanc
Copy link
Collaborator

Nice catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants