microsoft / pyright

Static Type Checker for Python
Other
13.12k stars 1.4k forks source link

Issue using pyright in Tinygrad. No issue in pylance. #8722

Closed aryang20 closed 1 month ago

aryang20 commented 1 month ago

I am following a tutorial based off the tinygrad documentation website. I should not see an error(tested it out with pylance and pycharm), however, I am seeing an error. It works fine when running it in terminal, also.

Screenshot 2024-08-09 at 12 43 52 PM

I am using tinygrad 0.9 and here is the link to the documentation website. I followed the MNIST tutorial.

I am simply using pylance to compare, and I am doing it to see why the issues in pyright are arising.

erictraut commented 1 month ago

You have once again not provided a minimal, self-contained code sample as requested in the bug report template and in my previous response.

The error you're seeing indicates that there is a type violation in your code. You are apparently attempting to pass a value of type MulNode to a parameter that is annotated as accepting only int values. Pyright is a static type checker, and it is designed to report such type violations.

Type checking is not enabled by default in pylance, so that's probably why you're seeing no error with pylance. If you do not want to see type errors in pyright, you can set the typeCheckingMode to "off".

aryang20 commented 3 weeks ago

kys