Type checker errors #4
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: greg/quoracle#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
https://paste.ubuntu.com/p/nYFVm6ZYCx/
I used pyright
Thanks so much for doing this @adsharma! I've been using mypy for type checking, and I've never heard of pyright before, so I'm happy to learn about something new! It looks like the majority of the errors reported by pyright involve it not understanding certain operators that have been overloaded? I'm not sure if pyright is misconfigured or maybe I'm misunderstanding something. I did find a couple of bugs in the report though, which I fixed in
457f5d1703
.Thanks. The reason why I use pyright is that it's fast enough to be integrated into an IDE (vscode) and can do incremental type checking. There is another type checker https://pyre-check.org/, which is written in Ocaml and I've used more of it in the past than pyright, but pyre isn't as well integrated into vscode.
Let me see if I can filter out the noise from the report so we can see the actual issues it may be reporting (and that mypy may have missed).
I suspect the problem is in correct usage of variance in generics:
https://mypy.readthedocs.io/en/latest/generics.html#variance-of-generics
I don't know if this is a pyright limitation or expr.py needs a fix.
https://paste.ubuntu.com/p/2sGVcdHYCk/
silences many errors (335 -> 92), but shouldn't really be necessary.
I also tried:
Probably best to distill it down to a minimal example and file an issue against pyright for further discussion.
Turns out to be a bug in pyright, to be fixed in the next version. We should rerun it once it's fixed for a less noisy output and see if it reports anything else significant.
Wow, thanks so so much for looking into this. Yes, let's definitely rerun after the bug is fixed.
The pyright bug is fixed in 1.1.128. Here's what it looks like:
$ pyright 2>&1 | pastebinit
https://paste.ubuntu.com/p/vYjnJRZrmJ/
$ mypy . 2>&1 | pastebinit
https://paste.ubuntu.com/p/vxSD5G3HTq/
This seems to be a mypy bug to me. pyright doesn't have the issue.
Also,
# type: ignore
is another way to silence type checker errors at a line level vs function level.pyright doesn't understand
no_type_check
.Updated pull request has 0 type errors on pyright and doesn't introduce any more type errors for mypy vs baseline.
https://github.com/mwhittaker/quoracle/pull/6