-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
automatic_names in Jupyter #29888
Comments
This comment has been minimized.
This comment has been minimized.
comment:3
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
I'm not sure that re-implementing this feature is worth the pain : it has the drawback of creating a symbolic variable for each instance of undefined Python identifier ; as a consequence, if the identifier is later re-used, the created symbolic variable still exists, but no valid reference to it exists. Nevertheless, a way to do this is to trap the "NameError" exception and treat it suitably (possibly only at the top level of the interpreter). This could be useful to clean up expression returned by some Maxima or Sympy routines creating such dynamic variables (integratin, differential equation solvers, and possibly others). A possibly more useful alternative coul be a function accepting some symbolic expression , finding all unbound identifiers and binding them to suitable symbolic variables. This should be trivial if one wants global identifiers. The REPL setup code might be the right place to implement this feature. An harder problem is to do this at the level of identifiers in the local frame of a defined (Python or Cython) function. While some idioms for dynamically creating new identifiers in the local frameof a function were published for Python 2.x interpreters, I am not aware of any such trick accepted in current or recent Python interpreters. |
See #9048 and #25837, among others. This was at least a reasonably often requested feature for teaching. Part of #29889.
Component: notebook
Issue created by migration from https://trac.sagemath.org/ticket/29888
The text was updated successfully, but these errors were encountered: