sashahafner / pystupid

Some notes on Python syntax and more
GNU General Public License v3.0
2 stars 0 forks source link

Reloading user-defined function #27

Open sashahafner opened 6 months ago

sashahafner commented 6 months ago

For one reason or another it seems you cannot (easily) reload a new function definition. I guess that is is hassle for me is a sign that I am testing functions in the wrong way, but exactly why isn't clear to me.

This answer explains how to use reload() but also stresses avoiding it:

https://stackoverflow.com/a/2534513/16958518

This has nothing else but does give a simple example

https://stackoverflow.com/questions/50268137/do-i-have-to-reload-a-module-in-python-to-capture-changes

sashahafner commented 6 months ago

Unit testing here

https://www.freecodecamp.org/news/how-to-write-unit-tests-for-python-functions/