Automagically inline python methods
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
inliner added readmes Aug 1, 2013
tests
LICENSE
readme.md Update readme.md Jun 17, 2015
runner.py Initial commit Jul 31, 2013
test_func.py

readme.md

Inliner inlines Python function calls. Proof of concept for this blog post

from inliner import inline

@inline
def add_stuff(x, y):
    return x + y

def add_lots_of_numbers():
    results = []
    for i in xrange(10):
         results.append(add_stuff(i, i+1))

In the above code the add_lots_of_numbers function is converted into this:

def add_lots_of_numbers():
    results = []
    for i in xrange(10):
         results.append(i + i + 1)