摘要: 函数调用时可能会出现数据类型不匹配的问题,为了保证代码的鲁棒性,最好加上数据类型检查。 应用举例: if not isinstance(x, (int, float)): raise TypeError('bad operand type') 详细应用后续补充 阅读全文
posted @ 2018-07-11 22:16 _最冷一天 阅读(205) 评论(0) 推荐(0) 编辑