# 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)
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源分类:Python库 所属语言:Python 资源全名:be_holder-1.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论


















收起资源包目录
















共 12 条
- 1
资源评论

挣扎的蓝藻
- 粉丝: 8w+
- 资源: 15万+

上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
安全验证
文档复制为VIP权益,开通VIP直接复制
