python code hot-swapping
Python
Latest commit 24e3241 Nov 12, 2012 @narfdotpl v0.1.0
Permalink
Failed to load latest commit information.
README.markdown v0.1.0 Nov 12, 2012
hottie.py switched to weak refs Nov 12, 2012
setup.py v0.1.0 Nov 12, 2012

README.markdown

hottie

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.

Usage

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.

Installation

pip install hottie

How it works

@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

Meta

Hottie is written by Maciej Konieczny. This software is released into public domain and uses semantic versioning for release numbering.