Tests also have the advantage of input automation. They have the disadvantage that you can't poke around at the environment once they're done (unless you drop into a debugger).
Re:Throw away code
by lukeschlather on Saturday September 26, 2020 @01:01AM
(#24596564)
I've found this is more and more the primary way I use the Python repl - I invoke pytest and tell it to drop me into the debugger if there's an error.
I usually have a test data set and run my module against it in IPython. So input is automated to some extent. If I'm analyzing the output, it can be helpful to quickly adjust charts and graphs. I'm now in the process of building distribution tests into my test suite, but it's not clear how to track everything. I need data sources essentially kept under version control, but which are generally too big for git.
Python has a lot of REPLs, which one in particular do you mean?
My personal choices are IPython and Jupyter, depending on whether I'm making plots. If you choose Jupyter, though, I caution that you should be careful you don't switch entirely away from modules and test suites. Jupyter can be too easy in a way.
This sounds quite a bit different from the sort of development work I do.
I can see how a REPL would be really useful when working with data, but for building out a webserver or desktop application, it doesn't have nearly as much value.
Also, it's more important the more data-dependent your code is.