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 mypy complaining about incompatible type for Z2 = Literal[0,1]. #118

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

dlyongemallo
Copy link
Contributor

Partially addresses #62.

@jvdwetering
Copy link
Collaborator

Thanks for the fixes, but #62 refers specifically to type annotations for numpy objects, while your commit deals with some type:ignore's in other libraries. Which is still welcome of course!

@jvdwetering jvdwetering merged commit 5f668ad into zxcalc:master Jun 28, 2023
@dlyongemallo
Copy link
Contributor Author

You're right, I should've removed that comment or made it more clear. This PR started out by reversing commit d7db04a and fixing each line which had # type: ignore, but I wasn't able to repro the mypy errors which were actually due to numpy. It seems that the problem has actualy been fixed in mypy prior to version 0.990, which you're using.

Also, according to python/mypy#1424, the problems with hasattr are fixed in 0.991, so if/when you upgrade to that version, you can remove the # type: ignores from the lines with hasattr in the pyzx code as well.

@dlyongemallo dlyongemallo deleted the fix_mypy_z2 branch June 30, 2023 14:14
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

Successfully merging this pull request may close these issues.

2 participants