-
Notifications
You must be signed in to change notification settings - Fork 764
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
"Expression value is unused" should not be reported for last expression in notebook cell #3282
Comments
This issue has been fixed in prerelease version 2022.11.31, which we've just released. You can find the changelog here: CHANGELOG.md |
I am still seeing this behavior in v2022.11.40 and v2022.11.41 (pre-release). |
What's your version of the jupyter extension? It may be providing its own errors in this situation if it's not the latest prerelease for jupyter too. (I ran into this problem too) |
Hi there. A generally preferable (opinion) way of working with notebooks is as raw code -- using something like Jupytext or Zed's Repl environ, both of which allow using comments to demarcate cells. (This allows for tool interoperation between python code and note books, useable git diffs, notebooks to be run as scripts, etc.) e.g. : # %%
preproced = "Hello, {{name}}, {{name}}, }}."
procd = replace_placeholder(preproced, "name", "__Alice__")
procd
# %%
procd_counted = extract_placeholders(procd)
len(procd_counted) Pyright, of course, doesn't recognize the comment syntax. Is there a way to give it a specific file or director over which the "unused expression" can be ignored? |
Sorry there's no way to specify that a |
These existing enhancement requests might cover the functionality that you are hoping to see. If so, please up-vote them: |
Jupyter notebook uses the last expression in each cell as the cell's output. Hence, it should not be reported as unused.
The text was updated successfully, but these errors were encountered: