Skip to main content

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


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)

Uploaded Source

Built Distribution

pyinline-0.0.2-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page