What kind of mistake can Pyright flag?
It reads Python code and checks assumptions about values, such as passing text into a function that expects a number. It reports problems in the editor or command line. Keep running tests for what the app should do with real inputs.
Why might the editor and the automated check disagree?
They can be checking different Python versions or finding different installed packages. Put the project’s supported Python version and checking settings in a shared configuration. Make sure both checks can find the same package types when the code uses third-party imports.
What do you need to run it?
Pyright is MIT-licensed. Choose a documented installation path for your editor or command line. Keep the version and settings with your build instructions, and account for the machine or runner that runs the check.
Where did the expected number become text?
Draw a fictional shipping quote that accepts a parcel weight as a number. Label the raw form input as text and trace it to the function.
- Mark the mismatchWrite down the expected type and the incoming type at the call site.
- Separate two checksSketch converting the text after checking it is valid, then add an example of an invalid value the application should handle at runtime.