Skip to content
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

Request for hint/example (documentation issue) #39

Open
rpgoldman opened this issue Apr 3, 2024 · 0 comments
Open

Request for hint/example (documentation issue) #39

rpgoldman opened this issue Apr 3, 2024 · 0 comments

Comments

@rpgoldman
Copy link

Something I would often like to do with jupyter_spaces is to do a bunch of computation with temporary variables, and assign the final result to a persistent/global variable. Right not, I have been doing this by defining simple zero-argument functions that encapsulate all the computation in a cell, and then invoke that function to catch the result. Something like

def cellFunc() -> <result type>:
   .....
   return foo

result1 = cellFunc()

where result1 is what I would like to share with other cells.

I feel like this should be doable with jupyter_spaces, but I don't sufficiently follow the discussion of scoping in the readme. There it says that all assignments are in the local scope, so I think in my example, result1 will not be visible outside. I can't tell whether there's anything I can do to "declare" a value in global scope to smuggle values out of the cell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant