4 ms·
Will the REPL allow you to easily edit function definitions and then reinterpret them?
by kovek 8y ago
Will the REPL allow you to easily edit function definitions and then reinterpret them?
- rspeer 8y agoI mean Jupyter doesn't really do that either, right? You can't edit most function definitions. Only ones that you've defined right there in the notebook, and only because you can run the cell that defines them again, overwriting the function. But if you do use libraries instead of just a huge mess of notebooks, you're stuck if you want to change the code in a well-supported way. You can ask your notebook to monkey-patch the code (which is an even bigger mess), or you can use an unreliable magic extension, "%autoreload".
- sstanie 8y agoYep, in the ipython REPL if you do %load_ext autoreload autoreload 2 it'll reload functions from any module you edit each time you run a new command.