.ipynb ! command inside if block produces pylance error #4935
Replies: 2 comments
-
Pylance does not currently treat Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
-
As @debonte said it is also not supported to assign the results of a shell command to a variable: For example, for: dir = "/"
files = ! ls $dir
print(files) I get the "Expected Expression" error message at the exclamation mark. On the other hand, if the exclamation mark is the first character in a line, I don't get any error. For example: dir = "/"
! ls $dir |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The following code in a .ipynb Python cell causes a PyLance error:
The last letter has a red squiggly underline, with PyLance complaining: "Expected: Expression".
Also note that it's very hard to actually click the buttons in that hover-box as it disappears when you move the mouse over to them (unless you're careful with your mouse movements).
Beta Was this translation helpful? Give feedback.
All reactions