-
Notifications
You must be signed in to change notification settings - Fork 19
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
inconsistent type issue of opx_driver.OPX.qua_program
#187
Comments
@sherbrooke-equal1 - I guess you're speaking on the opx_driver, right? I do not see any type hinting there in the main branch, are you on a side branch? @TheoLaudatQM - Do you know? In any case, |
i have added the type hints myself to illustrate the problem (read |
Ok, I looked at it again, I was wrong and it does return a I can't really see the issue... even when I add type hinting, but I'm using PyCharm. In any case, @TheoLaudatQM - is there any specific reason we went to this implementation of having an abstract method |
@sherbrooke-equal1 - Can you please see if PR-190 fixes it? |
the member
qua_program
returns an QUA program but it is used inget_prog()
as if it were an actual QUA program instanceThe recommended usage pattern is also to replace the method in the instance with a field containing the qua program instance and not with a callable method.
This causes type checking issues showing up in Pylance (VS Code) which complains about overwriting
() -> QuaProgram
with justQuaProgram
, and the result of respecting the typehintsinformation or as matter of fact leaving the method as-is would cause errors.My recommendation would be to change this so that qua_program would always be a field created in the constructor and assigned to maybe
_default_qua_program
which is a@staticmethod
.Original code for context (with added type hints and comment at type error):
The text was updated successfully, but these errors were encountered: