You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that when there is a variable, say foo, but then foo has been renamed for example, and there is some other code that references foo within the notebook, then this other code might be using a variable which you intended to remove or rename. To me, it's a common annoyance with notebook coding, and I'm sure to others as well.
Of course if you are using an IDE and a variable has been removed from the script, then the IDE should prompt you that it doesn't exist if it is being used. In the notebook it's more difficult because all variables are stored in the same memory once they are created.
To handle it, just as a thought, if a cell contained a variable named foo, then when that cell is re-executed and foo is no longer declared, then remove foo from memory and provide UI feedback that is has been removed from memory. I'm sure there's other edge cases.
The text was updated successfully, but these errors were encountered:
I agree. Allowing variables that do not appear into the code to exist in memory can lead to an array of bugs since it is extremely likely for programmers to forget renaming some of instance of the old variable and Python will not raise a NameError which sounds very dangerous to me.
Perhaps this functionality could be added as an option
The problem is that when there is a variable, say
foo
, but thenfoo
has been renamed for example, and there is some other code that referencesfoo
within the notebook, then this other code might be using a variable which you intended to remove or rename. To me, it's a common annoyance with notebook coding, and I'm sure to others as well.Of course if you are using an IDE and a variable has been removed from the script, then the IDE should prompt you that it doesn't exist if it is being used. In the notebook it's more difficult because all variables are stored in the same memory once they are created.
To handle it, just as a thought, if a cell contained a variable named
foo
, then when that cell is re-executed andfoo
is no longer declared, then removefoo
from memory and provide UI feedback that is has been removed from memory. I'm sure there's other edge cases.The text was updated successfully, but these errors were encountered: