Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/4383/contrat
Python module to keep function signature introspection compatibility between python version
https://github.com/4383/contrat
Last synced: about 2 months ago
JSON representation
Python module to keep function signature introspection compatibility between python version
- Host: GitHub
- URL: https://github.com/4383/contrat
- Owner: 4383
- License: mit
- Created: 2019-05-17T14:24:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-17T16:29:28.000Z (over 5 years ago)
- Last Synced: 2024-12-04T23:16:48.420Z (2 months ago)
- Language: Python
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/4383/contrat.svg?branch=master)](https://travis-ci.org/4383/contrat)
![PyPI](https://img.shields.io/pypi/v/contrat.svg)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/contrat.svg)
![PyPI - Status](https://img.shields.io/pypi/status/contrat.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
# contratSimple python module to keep function signature introspection compatibility between
python versions## Install
```shell
pip install contrat
```## Usage
The following example work for python 2.7 and python 3.0+:
```python
#!/usr/bin/python
from contrat import getargspecdef sample(arg1, arg2=True, arg3=1):
passprint(str(getargspec(sample)))
# will display
# ArgSpec(args=['arg1', 'arg2', 'arg3'], varargs=None, keywords=None, defaults=(True, 1))
```