2

Adding import readline to the source code affects builtin functions (like input() and raw_input()) enabling GNU readline, history and all that arrow stuff. I wonder, is there any way to undo it?

P.S. "Solutions" like del readline and from __builtins__ import raw_input don't work. You can try python2 -c "raw_input(); import readline; raw_input(); del readline; raw_input()" to check it.

Enr1g
  • 21
  • 1
  • Tried [this](https://stackoverflow.com/questions/1668223/how-to-de-import-a-python-module?answertab=active#tab-top) ? – fn. Feb 08 '18 at 21:19
  • @fn. yes. Doesn't help too. I guess, your solution is more about delete a name from a namespace than about undoing side effects of import. – Enr1g Feb 08 '18 at 21:31
  • How is `import readline` affecting your built in functions? Anything imported should be directly under `readline` like `readline.input()`? Unless you did something like `from readline import *` [which is the source your headache](https://docs.python.org/3/tutorial/modules.html#importing-from-a-package). – r.ook Feb 08 '18 at 21:41
  • @ldlehands importing readline does enable command line editing using GNU readline. Remember, whole module is executed/evaluated when you import it. – Arun Karunagath Feb 08 '18 at 23:18

0 Answers0