-
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
"..." is not iterable when calling a conditional return function #54
Comments
Thanks for reporting the issue, but there isn't enough information here for me to investigate further. I would need a self-contained code snippet or instructions for how to repro. Based on the screen shot above, it looks like there is a code path whereby importedStuff can contain None. This will result in an exception if you attempt to assign it a tuple. So without any additional details, it appears that this is a bug in your code that Pylance/Pyright has helped to identify. I recommend looking at the function |
I understand your argument about my code possibly returning def importStuff(fileName='ExportedObjs', ext='', path=''):
|
This particular diagnostic ("x is not iterable") should be associated with the diagnostic rule "reportGeneralTypeIssues". Currently, it's not. I'll make that change. Because of this, it is reported even if typeCheckingMode is set to "off". It should be reported only if typeCheckingMode is set to "basic" or "strict". |
Please feel free to close this then. I'll be on vacations for next two weeks. 🙂 |
This issue has been fixed in version 2020.7.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202070-9-july-2020 |
Environment data
Expected behaviour
No error
Actual behaviour
Logs
Code Snippet / Additional information
The text was updated successfully, but these errors were encountered: