You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Language Server version: Pylance language server 2021.11.0 (pyright fb86eac6)
OS and version: Windows 10 Enterprise (10.0.18363 Build 18363)
Python version (& distribution if applicable, e.g. Anaconda): 3.10
Expected behaviour
Pylance should not show any error for this line as it can be correctly unpacked.
Actual behaviour
The result returned from the function can be unpacked, however pylance incorrectly reports the error below indicating that it can't: Error message: 'Attempting to unpack a non-sequence' Details:
Note: In the examples above '[REDACTED]' is used to hide any non-required information.
defcheck_user_can_add_friend(username):
# Get subscription levelsubscription_level=user_get_subscription_level(username)
number_friend_requests=user_count_friend_requests(username)
number_friends=number_friend_requests+user_count_friends(username)
matchsubscription_level:
case"BASIC":
ifnumber_friends<5:
returnTrue, " "else:
returnFalse, "'"+username+"' can only have a maximum of 5 friends"case"GOLD":
ifnumber_friends<20:
returnTrue, " "else:
returnFalse, "'"+username+"' can only have a maximum of 20 friends"case _:
returnTrue, " "
If the above match statement is changed to an if and elseif statement then the error reported by pylance for un-packing will go away
The text was updated successfully, but these errors were encountered:
Environment data
Expected behaviour
Pylance should not show any error for this line as it can be correctly unpacked.
Actual behaviour
The result returned from the function can be unpacked, however pylance incorrectly reports the error below indicating that it can't:
Error message: 'Attempting to unpack a non-sequence'
Details:
Logs
Code Snippet / Additional information
Note: In the examples above '[REDACTED]' is used to hide any non-required information.
If the above match statement is changed to an if and elseif statement then the error reported by pylance for un-packing will go away
The text was updated successfully, but these errors were encountered: