Skip to content

How are packages imported affected when deleting cell? #768

Discussion options

You must be logged in to vote

Good question! Technically, they are still there (it's not possible to fully unload something in Julia), but they are no longer available in your scope.

In the future, we might prompt you to restart the notebook after unloading a package.

For example, an evil package might do this in its loading process:

Base.sqrt(x::Int64) = "potato"

hello(x) = "soup"

After loading the package (using import Pakcage in your notebook), calling sqrt(5) will return potato. After removing the cell containing import Package, you can no longer do Package.hello(123), but sqrt(123) will still return potato. The only (simple) solution is to restart the notebook.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@a9lara
Comment options

Answer selected by fonsp
Comment options

You must be logged in to vote
1 reply
@a9lara
Comment options

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