# Description:
A python dectorater to enforce type checks on your python functions for your stupid colleagues who pass int type when you clearly told them to pass string.
ヽ(ಠ_ಠ)ノ
You can define parameter and return types for your python functions using type hints (check them out here : https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html) and the watcher decorator over them to handle the dirty work.
Currently we only support positional arguments only and single return types but will add support for keyword arguments and mutiple return types.
Raise and issue in the gitrepo if you find any bugs or need a feature.
## Types Checking Supported for
> Positional Parameters
> Single return types
> User defined data types
# Example
```python
from be_holder import watcher
@watcher
def f(): # Will work as normal
return "pass"
@watcher
def f1(a:str,b): #Will be typed checked and will raise TypeError if types do not match
return "pass"
@watcher
def f2(a:str,b:int):
return "pass":
@watcher
def f3()>str: #Will raise a type error due to return type not matching function definition
return 1
@watcher
def f4(a:str)->str:
return "pass"
if __name__ == "__main__":
f4(1)
f2("s",1)
f2(1,1)
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共12个文件
py:4个
txt:3个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:be_holder-1.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
be_holder-1.2.tar.gz (12个子文件)
be_holder-1.2
PKG-INFO 2KB
be_holder
test_dec.py 2KB
__init__.py 29B
watcher.py 2KB
be_holder.egg-info
PKG-INFO 2KB
not-zip-safe 1B
SOURCES.txt 247B
top_level.txt 10B
dependency_links.txt 1B
setup.cfg 38B
setup.py 531B
README.md 1KB
共 12 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 12w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 常用工具集参考用于图像等数据处理
- 音乐展示网页、基于Stenography的图像数字水印添加与提取,以及基于颜色矩和Tamura算法的图像相似度评估算法py源码
- 基于EmguCV(OpenCV .net封装),图像数字水印加解密算法的实现,其中包含最低有效位算法,离散傅里叶变换算法+文档书
- 基于matlab+DWT的图像水印项目,数字水印+源代码+文档说明+图片+报告pdf
- (优秀毕业设计)基于python实现的数字图像可视化水印系统的设计与实现,多种数字算法实现+源代码+文档说明+理论演示pdf
- 基于DWT-DCT-SVD和deflate压缩的数字水印方法python源码+Gui界面+演示视频(高分毕业设计)
- 基于matlab实现DWT、DCT、SVD算法数字图像水印可视化系统+GUI界面+文档说明+详细注释(高分毕业设计)
- NCIAE-Data-Structure大一大二笔记
- 学习wireshark笔记
- digital-image-数据可视化笔记
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功