-
Notifications
You must be signed in to change notification settings - Fork 767
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
False alarm: reportGeneralTypeIssues #3359
Comments
Thanks for your report. As you noticed, yes, there is a difference in behavior in the insider builds. Specifically, for the insiders releases, we have changed the default type checking setting from You can turn off type checking with the following setting and that will revert to the old behavior.
Having type checking turned on has several benefits including catching errors early, spotting otherwise hard to find bugs. However, there are circumstances where type checking would be less advantageous - for example, when the code is a small use-once script. Also, when using libraries (like Django) that use dynamic typing, Pylance would complain about not being able to infer type info. This can become noisy. So, while I'd encourage you to keep the typechecking at 'basic' or even go to 'strict' for well annotated code and when using well typed libraries, if type checking is not appropriate for your codebase, you can turn it off with the setting above. In an upcoming release we will make changing type checking mode easier by adding that option right on the status bar. Look forward to any feedback you have on type checking modes. |
@huynd26, please file a new issue. |
Environment data
Code Snippet
Repro Steps
Expected behavior
According to Django documentation my code is valid (https://docs.djangoproject.com/en/4.1/topics/auth/default/#creating-users)
Actual behavior
Pylance highlights the above line and shows this error:
I ignore the error and run the code and it works fine so this is obviously a false alarm.
Logs
The text was updated successfully, but these errors were encountered: