2 ms·
I use compile/eval in an IRC bot I wrote (http://github.com/rmmh/skybot http://github.com/rmmh/skybot) for plugins. It lets me do hot-reloading of updated file
by Scaevolus 16y ago
I use compile/eval in an IRC bot I wrote (http://github.com/rmmh/skybot http://github.com/rmmh/skybot) for plugins.
It lets me do hot-reloading of updated files, easily examine the namespace to find functions marked with various decorators, and not litter the plugin directory with unnecessary .pyc files.
The builtin imp module has problems with reloading already-loaded modules, and I might have been able to do some weird hacks with __import__ to make it work like I wanted, but when the core functionality boils down to 3 lines of code, why bother?