跳转到主要内容

Python模块,用于在Python版本之间保持函数签名内省兼容性

项目描述

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

contrat

简单的Python模块,用于在Python版本之间保持函数签名内省兼容性

安装

pip install contrat

用法

以下示例适用于python 2.7和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=(True, 1))

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装软件包 的更多信息。

源分布

contrat-0.3.0.tar.gz (9.4 kB 查看哈希值)

上传时间:

构建分布

contrat-0.3.0-py2.py3-none-any.whl (6.5 kB 查看哈希值)

上传时间: Python 2 Python 3

支持