I always see people when writing tools in Maya call the reload function right after importing their module like so:
import my_cool_module reload(my_cool_module)
Why though? Isn’t it a waste of resources to reload something you just loaded? And if it’s already imported then instead of letting Python handle that by not importing it again, you explicitly force it to reload. Again, always forcing it to reload, every time a user just wants to launch your tool from a shelf button. I consistently see it in shelf buttons and tools downloaded on the internet.
I can see it being useful when you are developing and interacting with the code live. But after that, shouldn’t you remove the call to reload? I was always wondering if there is a better, legitimate reason for reloading? I don’t ship tools with a call to reload and so far I haven’t run into any issues.
I only see this in the realm of tools for animation, I don’t really see much other python code calling reload like this so often