Migrate prompt parsing logic to IPython.core.InteractiveShell
osolmaz opened this issue · comments
Currently, prompt parsing and interactive features such as package auto-installing, executing, etc. happen outside IPython parser. This has the following disadvantages:
- Prompts themselves are not stored in the history, but the Python code they resolve to
- The global and local namespaces have to be passed to
ICortex.eval_prompt()
in order to execute the Python code returned from services—if we implement the following steps, they can be accessed directly in the overloaded InteractiveShell
Steps:
- Create an overloaded version of
IPython.core.inputtransformer2
and migrate prompt parsing logic in there - Create an overloaded version of
IPython.core.InteractiveShell
which uses the overloadedinputtransformer2
and migrate interactive ICortex logic in there - Modify ICortexShell to use the overloaded InteractiveShell
This will most likely simplify ICortexShell.do_execute()
and resolve #10 automatically.
Possible issues:
- Will the interactive features (input() from the user) continue to work smoothly in both the shell and notebooks?