why I cannot use underscore as variable name in marimo #5193
The above code can run with out any issue in normal python. |
Answered by
bulletmark
Jun 5, 2025
Replies: 1 comment
|
You can use such variables, but any variable prefaced by an underscore is local to the cell. This is useful because it allows you to minimize scope, and avoid variable name clashes etc. This is how most Python users would expect name scoping to work in Marimo given underscore has always denoted "private". |
0 replies
Answer selected by
qiuwei
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

You can use such variables, but any variable prefaced by an underscore is local to the cell. This is useful because it allows you to minimize scope, and avoid variable name clashes etc.
This is how most Python users would expect name scoping to work in Marimo given underscore has always denoted "private".