Code hot-swapping for Python 2.7 classes and functions.
v0.1.0
GOAL: Feel a little bit like Bret Victor.
NON-GOAL: Provide a general solution for hot-swapping everything in all edge-case scenarios.
Decorate classes and functions that you would like to hot-swap with @hot
decorator:
from hottie import hot
@hot
class Rocket(object):
'...'
Check out the demo.
pip install hottie
@hot
functions are proxies to real functions and @hot
instances are observers that get their .__class__
changed when their class is updated. This slightly decreases performance. If you want to take advantage of hot-swapping only in development, use @hot
like this:
import hottie
if DEVELOPMENT:
hot = hottie.hot
else:
hot = hottie.identity
Hottie is written by Maciej Konieczny. This software is released into public domain and uses semantic versioning for release numbering.