from schemer import Schema

def func(account, password):
request_params = {
'account': account,
'password': password,
'name': '卢'
} param_schema = Schema({
'account': {'type': basestring, 'required': True},
'password': {'type': basestring, 'required': True},
}, strict=False) # strict=False 可以允许多传递参数 param_schema.validate(request_params) # 检测不通过直接抛异常
param_schema.apply_defaults(request_params) # attach 默认值 if __name__ == '__main__':
func('111','222')

  

最新文章

  1. php throw new Excpetion()之后,程序还往下继续运行吗?
  2. MemoryStream类
  3. python实现tailf
  4. 浅谈程序员创业(要有一个自己的网站,最好的方式还是自己定位一个产品,用心把这个产品做好。或者满足不同需求的用户,要有特色)good
  5. 关于java.sql.SQLRecoverableException: Closed Connection异常的解决方案(转)
  6. iOS获取网络时间与转换格式
  7. TRIZ系列-创新原理-32-改变颜色原理
  8. JAVA List<T> 如何初始化
  9. Shiro 加密helloWorld
  10. Scala编程入门---面向对象编程之Trait高级知识
  11. c++字节对齐
  12. web.xml中三种通配符及匹配规则
  13. Mysql分组查询group by语句详解
  14. TensorFlow学习入门
  15. InnoDB Next-Key Lock
  16. 【three.js练习程序】创建简单物理场景
  17. bitnami下webmin安装
  18. Ubuntu中Samba的安装配置和使用
  19. 如何在 block 中修改外部变量
  20. Information:java: Errors occurred while compiling module 'spring'

热门文章

  1. Dynamics365 DOC
  2. Day 23 23.2:逆向前期准备
  3. 回归分析 3.X 多元线性回归
  4. Codeforces 1228A、Distinct Digits
  5. vite+vue3.0+ts搭建项目
  6. CF1268B题解
  7. 微信小程序 table表格 固定表头和首列 右侧表格可以左右滚动(多种表格演练)
  8. getClassLoader
  9. 批量添加esxi主机到Vcenter
  10. JavaScript基础知识整理(引用类型-Function)