-
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
Unpacking multiple iterables yields false negatives #2371
Comments
Black also doesn't understand this expression: psf/black#2878 |
also note that this syntax is only valid for Python >= 3.9 |
Thanks for the bug report. I wasn't aware of this change to the grammar in Python 3.9. Since this is a core type checker issue, I've created a tracking bug in the pyright repo. microsoft/pyright#3029 |
This will be fixed in the next release. |
This issue has been fixed in version 2022.2.3, which we've just released. You can find the changelog here: CHANGELOG.md |
expected expression error in visual studio code from an elif statement I tried to run. parenthesis only fixed if statement error, I', finding a hard time finding a solution for my current problem. following a PyCharm tutorial btw; but I'm having a hard time downloading it. https://www.youtube.com/watch?v=0fC1JsN8AsM 39:42 |
@realworldhacker, I copied the code from that spot in the video (see below) and Pylance doesn't show any errors for me, so I'm assuming you have a typo somewhere in the code. One wild guess is that you typed If you believe that there is a problem with Pylance here, please open a new issue and include a minimal code snippet that reproduces the problem. fnum = input("What is the first number ")
snum = input("What is the second number")
if fnum > snum:
print("The first number is larger!")
elif snum > fnum:
print("The second number is larger. ")
else:
print("The numbers are the same") |
Environment data
Expected behaviour
To not flag anything as wrong.
Actual behaviour
Multiple errors errors found:
Logs
Code Snippet / Additional information
The following executes w/o problems in Python:
Yields the following output:
But pylance marks the first
*
in line 4 (thefor
-loop) withExpected expression
, the colon in the same line asExpected ":"
, and the second unpacking in line 7 (wherec
is assigned) asOnly one unpack operation allowed in list
.This is probably (partly?) related to #700.
The text was updated successfully, but these errors were encountered: