Skip to main content

Python module to keep function signature introspection compatibility between python version

Project description

Build Status PyPI PyPI - Python Version PyPI - Status Code style: black

contrat

Simple python module to keep function signature introspection compatibility between python versions

Install

pip install contrat

Usage

The following example work for python 2.7 and python 3.0+:

#!/usr/bin/python
from contrat import getargspec

def sample(arg1, arg2=True, arg3=1):
    pass


print(str(getargspec(sample)))
# will display
# ArgSpec(args=['arg1', 'arg2', 'arg3'], varargs=None, keywords=None, defaults=(False, 1))

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

contrat-0.1.0.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

contrat-0.1.0-py2.py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 2 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