typepyPython 变量类型检查器
typepy 是一个 Python 库,用于运行时的变量类型检查器/验证器/转换器。
特征
- 检查值的类型
- 验证类型的值
- 将值从一种类型转换为另一种类型
Python 类型和typepy
类的对应关系如下:
支持的类型
Python 类型 | typepy:类型类 |
---|---|
bool |
Bool |
datetime |
DateTime |
dict |
Dictionary |
float /decimal.Decimal (not infinity/NaN) |
RealNumber |
float /decimal.Decimal (infinity) |
Infinity |
float /decimal.Decimal (NaN) |
Nan |
int |
Integer |
list |
List |
None |
None |
str (not null) |
String |
str (null) |
NullString |
str (IP address) |
IpAddress |
安装
安装:pip
pip install typepy
如果使用typepy.DateTime
类,请使用以下命令安装其他依赖包
pip install typepy[datetime]
安装:conda
conda install -c conda-forge typepy
安装: apt
sudo add-apt-repository ppa:thombashi/ppa sudo apt update sudo apt install python3-typepy
依赖关系
- Python 3.6+
- Python 包依赖(自动安装)
可选依赖
这些软件包可以通过pip install typepy[datetime]
以下方式安装:
- python-dateutil
- pytz
评论
SorbetRuby 类型检查器
Sorbet,一个快速且强大的Ruby类型检查器,大部分代码都是用Ruby编写的,为Ruby开发环境提供了类似IDE的特性,包括自动完成和跳转到定义等。包括内容核心静态类型检查器创建新的Sorbet项
SorbetRuby 类型检查器
0
Hegel高级静态类型检查器
Hegel是JavaScript的类型检查器,具有可选的类型注释并防止运行时类型错误。没有运行时类型错误。Hegel有一个强大的类型系统和健全性检查。这意味着他能发现任何可能在运行时抛出的类型错误。可
Hegel高级静态类型检查器
0
is WhatJS 类型检查工具
isWhat是一个非常简单且小巧的JS类型检查功能,它同样完全支持TypeScriptnpmiis-what用法is-what很容易使用,并且大多数功能都可以像你所期望的那样工作。//importfu
is WhatJS 类型检查工具
0
PyrePython 类型检查工具
Pyre是一个快速、可扩展和高性能的Python类型检查工具,适用于大型的 Python3代码库,旨在通过在终端或编辑器中以交互方式标记类型错误来帮助提高代码质量和开发速度。Pyre随附了Pysa,这
PyrePython 类型检查工具
0