pyinline, a script for inlining functions that have been decorated with the `@inline` decorator.
Project description
Pyinline
A function inliner for Python. Import inline
from pyinline
and run:
$ python -m pyinline source.py
This will convert the following:
from pyinline import inline
import logging
log = logging.getLogger(__name__)
@inline
def log_error(msg: str, exception: Exception):
log.error(msg, exception, exc_info=True)
try:
x = 1 / 0
except Exception as e:
log_error("Could not divide number", e)
will generate:
import logging
log = logging.getLogger(__name__)
try:
x = 1 / 0
except Exception as e:
log.error("Could not divide number", e, exc_info=True)
Call with --diff
to generate a patch.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyinline-0.0.2.tar.gz
(4.7 kB
view hashes)