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

Protocols should be decorated with @typing.runtime_checkable to be able to use isinstance checks #86

Open
VolodyaCO opened this issue Nov 1, 2023 · 0 comments

Comments

@VolodyaCO
Copy link
Contributor

Is your feature request related to a problem? If so, please describe it.

In qml-core, we make checks of the form isinstance(self._backend, WavefunctionSimulator). Apparently, in python 3.11+, these sort of checks cannot be made if the class is a Protocol unless they are decorated with @typing.runtime_checkable. Can we add these decorators to all protocols in orquestra-quantum to avoid this issue in the future?

How you envision the solution

Just add the decorator on top of every Protocol.

Describe alternatives you've considered

None

Additional context

n/a

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

1 participant